简体   繁体   English

将DLL部署到特定位置

[英]Deploying DLLs to a Specific Location

I'm in Visual Studio 2019, and I'd like to deploy all the DLLs in my project to a DLL folder and have the exe in another folder. 我在Visual Studio 2019中,我想将项目中的所有DLL部署到DLL文件夹中并将exe放在另一个文件夹中。 I don't see an option for that really though. 我确实没有看到这样的选择。 Can I do that? 我可以这样做吗?

As described in the documentation , assemblies are located using a particular algorithm. 文档所述 ,程序集使用特定算法定位。 One part of that algorithm is to check the configuration file for codeBase elements . 该算法的一部分是检查配置文件中的codeBase元素 These elements define a specific location (per assembly and version) to search for a particular assembly. 这些元素定义特定位置(按程序集和版本)以搜索特定程序集。

Alternatively, you can set the privatePath value for the probing element . 另外,您可以设置probing元素privatePath值。 This would affect all DLLs for your application whereas the above could target specific DLLs. 这将影响您的应用程序的所有DLL,而以上内容可能针对特定的DLL。

So you would set up a post-build step to copy your DLLs (and/or EXE) to the destination folder, and update your app.config to have the appropriate <codeBase> or <probing> elements which point to that destination folder. 因此,您将设置一个构建后步骤,以将DLL(和/或EXE)复制到目标文件夹,并更新app.config以使其具有指向该目标文件夹的相应<codeBase><probing>元素。

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

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