How to build same project with multiple configurat

2019-02-28 05:06发布

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条回答
beautiful°
2楼-- · 2019-02-28 05:29

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.

查看更多
登录 后发表回答