Import .targets file from command line in msbuild

后端 未结 4 1681
心在旅途
心在旅途 2021-02-15 02:44

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"
    

提交回复
热议问题