This project references NuGet package(s) that are missing on this computer

后端 未结 19 1449
南方客
南方客 2020-11-28 00:29

I have an ASP.NET MVC5 application that worked yesterday and now I am getting this error when I try to build:

This project references NuGet package(s)

19条回答
  •  自闭症患者
    2020-11-28 01:20

    I created a folder named '.nuget' in solution root folder Then added file 'NuGet.Config' in this folder with following content

    
    
    
     
    
    
    

    Then created file '.nuGet.targets' as below $(MSBuildProjectDirectory)..\

        
        false
    
        
        false
    
        
        true
    
        
        false
    
    
    
        
        
    
    
    
        
        $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
        $([System.IO.Path]::Combine($(ProjectDir), "packages.config"))
        $([System.IO.Path]::Combine($(SolutionDir), "packages"))
    
    
    
        
        $(SolutionDir).nuget
        packages.config
        $(SolutionDir)packages
    
    
    
        
        $(NuGetToolsPath)\nuget.exe
        @(PackageSource)
    
        "$(NuGetExePath)"
        mono --runtime=v4.0.30319 $(NuGetExePath)
    
        $(TargetDir.Trim('\\'))
    
        -RequireConsent
        
        $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)"  $(RequireConsentSwitch) -o "$(PackagesDir)"
        $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols
    
        
        
            RestorePackages;
            $(BuildDependsOn);
        
    
        
        
            $(BuildDependsOn);
            BuildPackage;
        
    
    
    
        
        
        
        
    
    
    
        
    
        
    
    
    
        
    
        
    
    
    
        
            
        
        
            
            
            
            
            
            
            
                
            
        
    
    
     
        
            
            
        
        
            
            
                
            
        
    
    

提交回复
热议问题