简体   繁体   English

是否有包含 Visual Studio 2010 项目中文件的命令?

[英]Is there a command that includes files in a project of Visual Studio 2010?

I'm developing a web project that consists from many other projects, so when I build my main project I need to copy some resource files to the folder of main project and make all copied files as included in this project.我正在开发一个由许多其他项目组成的 web 项目,所以当我构建我的主项目时,我需要将一些资源文件复制到主项目的文件夹中,并将所有复制的文件包含在这个项目中。

I'm using post event feature for doing this.我正在使用发布事件功能来执行此操作。

xcopy /E /Y  "SourcePath1" "$(ProjectDir)Scripts\"
xcopy /E /Y  "SourcePath2" "$(ProjectDir)Scripts\"
xcopy /E /Y  "SourcePath3" "$(ProjectDir)Scripts\"

this command copies my files, but these files are not included in the project.此命令复制我的文件,但这些文件不包含在项目中。 What command can I use for including copied files?我可以使用什么命令来包含复制的文件?

I need something like我需要类似的东西

include "pathtwherefilesare" 

Thanks!谢谢!

There is a icon in the solution explorer to "show all files".解决方案资源管理器中有一个图标可以“显示所有文件”。 Then you can include (right click) these files to your project.然后您可以将这些文件包含(右键单击)到您的项目中。

you can copy once, and add copied files to project, then commands will replace old files with new ones您可以复制一次,并将复制的文件添加到项目中,然后命令将用新文件替换旧文件

Hope this helps希望这可以帮助

If your project is a web application project (as opposed to web site project), try Add Existing Items , select the files, and select Add as Link from the Add button dropdown menu. If your project is a web application project (as opposed to web site project), try Add Existing Items , select the files, and select Add as Link from the Add button dropdown menu.

Edit the files' Build Action and Copy to Output Directory settings as required.根据需要编辑文件的Build ActionCopy to Output Directory设置。

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

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