How to get nuget restore in TFS build

后端 未结 2 1737
别那么骄傲
别那么骄傲 2021-01-21 04:36

I can\'t make it work TFS build. It is nuget restore issue. Nuget is not restoring reference dll files.

Here is belwo my build configuration. Please advise me how I can

2条回答
  •  耶瑟儿~
    2021-01-21 05:03

    As per this blog post on Nuget's website you can use the command line you mentioned, but it has to be part of a custom target using a Build.proj file.

    You need to add a Build.proj and put this as the contents:

    
    
    
      
        $(MSBuildThisFileDirectory)bin\
        Release
        $(MSBuildThisFileDirectory)src\
        $(MSBuildThisFileDirectory)tools\
      
    
      
        
          OutDir=$(OutDir);Configuration=$(Configuration)
        
      
    
      
        
      
    
      
        
      
    
      
        
      
    
      
        
      
    
    
    

    Alternatively, you could call it from a custom Pre-Build Script.

    Or, customise the XAML template and add a Foreach loop to invoke:

    nuget.exe restore path\to\solution.sln
    

    on each solution in the build definition.

提交回复
热议问题