在 Visual Studio 2008 C# 中更改 Dll 文件夹

发布于 2024-08-23 10:58:49 字数 290 浏览 3 评论 0原文

我的解决方案中有 2 个项目。第一个是控制台应用程序,第二个是 dll,由控制台使用(引用)。当我构建解决方案(发布)时,我得到一个 EXE 文件和一个 DLL 文件,因为 copy localtrue (如果我将其设置为 false >,它不运行)。

如何将该 DLL 文件存储在子目录中?如果我的输出文件夹是 C:\123\,并且有 EXE 文件,我希望所有 DLL 都位于 C:\123\Dll\ 中。

I have 2 projects in my solution. The first one is a console application, and the second is a dll, used (referenced) by the console. When I build my solution (release) I get one EXE file and one DLL file, because copy local is true (if I set it to false, it doesn't run).

How can I store that DLL file in a subdirectory? If my output folder is C:\123\, and there's the EXE file, I want all my DLLs to be in C:\123\Dll\.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

黎歌 2024-08-30 10:58:49

您应该能够使用探测元素来指定您的路径应用程序在尝试解决 dll 依赖关系时应使用。

示例:

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <probing privatePath="123;123\dill"/>
      </assemblyBinding>
   </runtime>
</configuration>

您还可以使用 构建后事件命令行 将您的 dll 复制到特定目录。

You should be able to use the probing element to specify which paths your application should use when attempting to resolve dll dependencies.

Example:

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <probing privatePath="123;123\dill"/>
      </assemblyBinding>
   </runtime>
</configuration>

Also you can use the Post-build event command line to copy your dll's to a particular directory.

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