MSBuild - Set Properties For Solution

前端 未结 3 2097
刺人心
刺人心 2021-02-19 03:13

We are using .NET 3.5 with VS2008. I have a solution with ~20 projects in it, and that number will grow over time as the application grows and adds new modules. Today I needed

相关标签:
3条回答
  • 2021-02-19 03:54

    You can specify this property, and all the other common ones, in a single file, and load it by including in your project files an Import statement. This is what we do in our build environment, which has something like 220 built projects and multiple shared project files (e.g., "branch"). It works well.

    0 讨论(0)
  • 2021-02-19 04:00

    I have implemented the solution suggested by @fatcat111 a number of times now. This time I have automated this process by using NuGet - Common.Props. The package will add a common props file at a solution level and by installing the package in multiple projects of the same solution the properties can be shared.

    The code is on GitHub.

    0 讨论(0)
  • 2021-02-19 04:04

    Since Solution files are not MSBuild files you won't be able to perform such operations. You only choice is to deal with it or to use a master msbuild file in place of building the solution file. One option could be to create a special configuration that is used by your build process. And for solution files you can specify the configuration used.

    0 讨论(0)
提交回复
热议问题