How to build same project with multiple configuration C# VisualStudio2012

好久不见. 提交于 2019-12-02 13:40:05

问题


I have a solution with many projects.
I Would like to build several projects with multiple configuration settings.

e.g:
ProjectA is set as target framework: 3.5 and platform target x86.
output assembly name is: ProjectA.dll.

I want, when clicking the build button, to build the project in several output files:
ProjectA_3.5_x86.dll - for Target framework 3.5 and platform x86
ProjectA_4.5_x64.dll - ...

This is what buildservers does.

Is there a way to have config file that build operation looks at, and then determine how to build each projects, with different assembly names and different build configurations ?

Thanks !


回答1:


As far as I know, you can only produce one dll per compile of a project. It sounds like what you would want to do is create different build configurations; which can be done by manually editing the project file or using the configuration manager. You can set up different configurations (3.5 framework, x86 CPU, with an assembly name of xxx.yyy) and then select that configuration when you do a compile. However, it is important to understand that you will have to do multiple compiles on your code, selecting the different configurations, to produce the different dlls. If you have an automated build process, you should be able to just set up the project to compile multiple times and change the configuration name.



来源:https://stackoverflow.com/questions/15321757/how-to-build-same-project-with-multiple-configuration-c-sharp-visualstudio2012

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