Nant 将所有文件复制到输出 - 是否需要这样做? / Visual Studio 构建过程

发布于 2024-08-23 12:22:32 字数 587 浏览 3 评论 0原文

当您在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

九歌凝 2024-08-30 12:22:32

解决了。
使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文