Msbuild command line argument at project-level not solution-level for changing AssemblyName

后端 未结 1 2026
时光取名叫无心
时光取名叫无心 2020-12-18 07:03

Is there any way to specify a command line argument for msbuild that will apply only to one project (i.e. project-level not solution-level), when building a multi-project so

相关标签:
1条回答
  • 2020-12-18 07:07

    You can edit your project in question (its .csproj file) to obtain assembly name from a special property if it is specified, i.e.:

    <AssemblyName Condition=" '$(ThisProjectNameOverrideAssemblyName)' == '' " >UsualAssemblyName</AssemblyName>
    <AssemblyName Condition=" '$(ThisProjectNameOverrideAssemblyName)' != '' " >$(ThisProjectNameOverrideAssemblyName)</AssemblyName>
    

    So when you build your project in question, you pass your ThisProjectNameOverrideAssemblyName to override AssemblyName for this project only:

    msbuild /p:ThisProjectNameOverrideAssemblyName=NewAssemblyName
    
    0 讨论(0)
提交回复
热议问题