How do I import the msbuildcommunitytasks project from another msbuild project with a relative file path?

后端 未结 6 2209
再見小時候
再見小時候 2020-12-16 02:46

Please go easy I am new to msbuild and msbuildtasks!

How can I set a property which represents a relative file path to a targets file which I want to import? I need

6条回答
  •  醉酒成梦
    2020-12-16 03:10

    Ok, I've found the answer. Essentially you have to set the property MSBuildCommunityTasksPath as a relative path back to the original containing directory.

    For example, given a folder structure like this:

    Root---project---Build---{My msbuild project}
               |
               |-Tools---MSBuildCommunityTasks---{Binaries and Targets}
    
    Where :
    {My msbuild project} is in Root\Project\Build\
    {MSbuildCommunityTasks} is in Root\Project\Tools\MsBuildCommunityTasks

    To get the targets project to reference its binaries via the property MSBuildCommunityTasksPath, it will find the tasks file like this:

    
        ..\MSBuildCommunityTasks\ 
    
    

    Then you can import the targets file with another relative file reference :

      
    

提交回复
热议问题