Import .targets file from command line in msbuild

后端 未结 4 2170
野性不改
野性不改 2021-02-15 02:23

I currently have multiple projects being build using msbuild. I have a small customisation to the build that is handled by a .targets file. One solution is to add the snippet

4条回答
  •  余生分开走
    2021-02-15 03:21

    Lets say you have a project file called "Project.msbuild". You would add this conditional import:

    
    

    Then pass the name of the target file you want to import as an msbuild property:

    msbuild.exe Project.msbuild /p:TargetToImport="TargetFile.Target"
    

提交回复
热议问题