简体   繁体   English

将现有文件添加到不同的Visual Studio 2010项目

[英]Adding Existing Files To Different Visual Studio 2010 Project

It is possible to add files to a visual studio project that is located in a different directory however keep the files in those directories and update those file when you update the file in the project? 可以将文件添加到位于不同目录中的visual studio项目中,但是将文件保留在这些目录中并在更新项目中的文件时更新这些文件? When I add existing files to a project, all it does is copy them to the project and then update the copied files, not the original files. 当我将现有文件添加到项目时,它所做的就是将它们复制到项目中,然后更新复制的文件,而不是原始文件。 Is there any way to get it to work the other way? 有没有办法让它以其他方式工作?

You should add them as a link/shortcut 您应该将它们添加为链接/快捷方式

Right-click the project, select Add > Existing Item, and in the dialog, "Add" drop down, select "Add As Link". 右键单击项目,选择“添加”>“现有项”,然后在对话框的“添加”下拉列表中选择“添加为链接”。

  1. Open Visual Studio 打开Visual Studio
  2. Right lick the solution Explorer and select Add | 右键单击解决方案资源管理器并选择添加| Existing item... 现有项目......
  3. Select the file and question, but in the "Add" drop down select Add as Link. 选择文件和问题,但在“添加”下拉列表中选择添加为链接。

Alternatively I would suggest creating a class library project that you share in both solutions, this might benefit you in the future. 或者,我建议您创建一个您在两个解决方案中共享的类库项目,这可能会在将来受益。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM