How to save DLLs in a different folder when compiling in Visual Studio?

烈酒焚心 提交于 2019-11-27 07:26:14
Alexei Levenkov

There are 2 parts of your question:

How to configure solutions to build assemblies/EXE into folders of your choice - this is configured through properties of the project in VS (project properties -> build -> output path). Also value of check "copy local" property on each reference.

How to load assemblies files from non-default locations (i.e. from your ...\Libraries folder) - you need to make changes to your app.config file to add this non-default paths to assembly search location ( http://support.microsoft.com/kb/837908 ).

Correct answers were given earlier. I'll just mention that there is a nuget package for this called PrettyBin.

Install it on your startup project. DLLs and XMLs will go to a lib folder and you'll have a working example of how it's done, if you won't to customize.

Set Reference path in project peoperties.

You can also specify where your compiled exe goes by specifying Output path in project peoperties.

You'll find best practices for organizing project references here: http://codebetter.com/patricksmacchia/2009/01/11/lessons-learned-from-the-nunit-code-base/

Look under chapter "The VisualStudio Project Reference + Copy Local true option is evil!"

Doug Chamberlain

Yes it is possible, you'd do it in your msbuild script. While I can't give you an exact answer, look here at this question on SO Copy all files and folders using msbuild

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!