简体   繁体   English

VS2010发布后从bin复制文件

[英]VS2010 copy files from bin after publish

Solution contains 2 projects. 解决方案包含2个项目。 All of them are mvc sites, but on the second site the file global.asax was deleted.The first project has reference to the second. 它们都是mvc站点,但是在第二个站点上删除了文件global.asax。第一个项目引用了第二个项目。 All views, images, js and css files of the second project have attribute "copy always". 第二个项目的所有视图,图像,js和css文件都具有“始终复制”属性。 In the first project in post-build event command line I added a script which copies these files from bin to another folder("Base"). 在构建后事件命令行中的第一个项目中,我添加了一个脚本,该脚本将这些文件从bin复制到另一个文件夹(“ Base”)。 After build everything is working fine, but after publishing with "in file system" method the files don't copy from bin folder. 生成后,一切工作正常,但是使用“在文件系统中”方法发布后,文件不会从bin文件夹复制。 "Base" folder isn't added to the first project, it is created after the first build. “基础”文件夹没有添加到第一个项目,而是在第一次构建后创建的。

  1. Set project build order 设置项目构建顺序

  2. Copy manually in the Post-buid event like this. 像这样在发布后事件中手动复制。

COPY "$(TargetDir)*.*" "c:\\MySolution\\MyProject\\etc"

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

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