“添加链接”失败 [英] "Add a link" fails

查看:114
本文介绍了“添加链接”失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 10上运行Visual Studio 2017.我在解决方案中有6个项目。  我有一个网络项目。  我需要在两个单独的目录中将文件放在同一个文件中(长话,不要问)。  由于安全要求,我
不能只有一个文件。  我想在VS中创建一个链接文件,以便我的代码只在一个位置。  我试图添加现有文件,我选择文件,我选择"添加为链接"; (或任何文字说明),以及"add
file"对话框关闭,未添加任何链接。  问题:

I am running Visual Studio 2017 on Windows 10.  I have a 6 projects in a solution.  I have one web project.  I need to have a file in the same file in two separate directories (long story, don't ask).  Due to security requirements, I can't just have one file.  I would like to create a linked file in VS so that my code is only in one spot.  I have tried to go into add an existing file, I select the file, I select "add as link" (or whatever the text says), and the "add file" dialog closes with no link added.  Questions:


  • "添加链接"的条件是什么?作品?  我的驱动器是NTFS驱动器,这是我可以找到的唯一条件。  在任何地方都没有Fat32。
  • 我可以手动创建一个链接文件来解决这个错误吗?

Wally

ASPInsider - 作者 - 否则我是输家。

ASPInsider - Author - Otherwise I am a loser.

推荐答案

尝试手动添加到.csproj文件:

Try adding it manually to the .csproj file:

<ItemGroup>
    <Compile Include="..\..\MyFile.cs">
      <Link>MyFolder\MyFile.cs</Link>
    </Compile>
</ItemGroup>


这篇关于“添加链接”失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆