Nant 将所有文件复制到输出 - 是否需要这样做? / Visual Studio 构建过程
当您在 Visual Studio (VS) 中编译项目时,作为编译的一部分,VS 会获取所有不在 GAC 中的引用库,并将它们复制到构建的输出文件夹中。例如
ProjectA.Dll
- 引用:ProjectB.Dll
- 引用:ProjectC.Dll
在bin\debug 文件夹中,您将找到ProjectA.dll、ProjectB.dll 和ProjectC.dll。
我现在在 Nant 中尝试做的是构建一个 .exe 文件,我认为(除非我弄错了)除非引用库位于 GAC 中,否则 .exe 文件将需要所有引用 Dll 位于同一文件夹中。
所以我的问题是:有没有办法让 Nant 自动执行此操作?在 Nant 的 .build 文件中我的项目的 CSC 标记中,我指定了所需的引用,如下所示:
<references> <include..... ./> </references>
但这不会使引用输出到目标构建文件夹中。
我是否需要将 .exe 的所有引用文件手动移至其构建文件夹中?
谢谢。
When you compile a project in Visual Studio (VS), as part of the compilaton VS takes all of the referenced libraries that are not in the GAC and copies them to the output folder of your build. e.g.
ProjectA.Dll
- References: ProjectB.Dll
- References: ProjectC.Dll
In the bin\debug folder you will find ProjectA.dll, ProjectB.dll and ProjectC.dll.
What I am trying to do now in Nant is to build a .exe file and I think (unless I am mistaken) that unless the references libraries are in the GAC then the .exe file will need all of the references Dll's in the same folder.
So my question is: is there a way I can make Nant do this automatically? In the CSC tag for my project in the .build file for Nant I have specified the references needed as follows:
<references> <include..... ./> </references>
But this does not make the references output into the target build folder.
Will I need to move all references files for my .exe manually into its build folder?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了。
使用 MSBuild 编译解决方案意味着您不需要向 CSC 提供参考。
这还将所有必需的文件输出到输出 bin 文件夹。
Solved.
Using MSBuild to compile the solution means that you dont need to give CSC the references.
This also outputs all required files to the output bin folder.