我的解决方案中有 2 个项目。第一个是控制台应用程序,第二个是 dll,由控制台使用(引用)。当我构建解决方案(发布)时,我得到一个 EXE 文件和一个 DLL 文件,因为 copy local
为 true
(如果我将其设置为 false
>,它不运行)。
如何将该 DLL 文件存储在子目录中?如果我的输出文件夹是 C:\123\
,并且有 EXE 文件,我希望所有 DLL 都位于 C:\123\Dll\
中。
最佳答案
您应该能够使用 probing element指定您的应用程序在尝试解析 dll 依赖项时应使用哪些路径。
示例:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="123;123\dill"/>
</assemblyBinding>
</runtime>
</configuration>
您也可以使用Post-build event command line将您的 dll 复制到特定目录。
关于visual-studio - 在 Visual Studio 2008 C# 中更改 Dll 文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2363691/