Specify assembly version number as a command line argument in MSBuild

后端 未结 3 848
后悔当初
后悔当初 2020-12-13 02:43

I would like to be able to specify the version number for all assemblies to be generated during a build as a MSBuild command argument like this:

MSBuild.exe          


        
3条回答
  •  一向
    一向 (楼主)
    2020-12-13 03:44

    I know this is an old question but Google leads me to here as top result.

    I followed a simple solution in this. No need for extension pack.

    Basically what you need to do is add a "BuildCommon.targets" files and modify your csproj file accordingly to have the version number specified in msbuild like:

    msbuild.exe abc.sln /p:Configuration=Release;VersionAssembly=1.2.3.4
    

    Hope this helps.

提交回复
热议问题