How can I get MSBUILD to evaluate and print the full path when given a relative path?

前端 未结 5 840
情话喂你
情话喂你 2020-12-13 17:05

How can I get MSBuild to evaluate and print in a task an absolute path given a relative path?

Property Group

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-13 17:29

    You are trying to access an item metadata property through a property, which isn't possible. What you want to do is something like this:

    
      c:\Program Files (x86)\Program\
    
    
       
         
    
       
    
    

    Which will generate output as:

     Copying 'C:\Users\sdorman\Desktop' to 'c:\Program Files (x86)\Program\'
    

    (The script was run from my Documents folder, so ..\Desktop is the correct relative path to get to my desktop.)

    In your case, replace the "..\Desktop" with "......\Public\Server" in the Source_Dir item and you should be all set.

提交回复
热议问题