NuGet has problems with missing packages, how to restore?

前端 未结 5 1643
长情又很酷
长情又很酷 2021-02-05 04:52

When I try to compile my program I get the following error:

This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Res         


        
5条回答
  •  故里飘歌
    2021-02-05 05:03

    I ran into this issue when I tried to build my project on a computer where the packages-folder did not already exist in the solution root.

    When the project file was initially created, it seems VS2019 added the following into the project file:

    
        
          This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
        
        
    
    

    From what I understand those settings are deprecated nowadays, no idea why VS inserted it in the first place.

    Anyway, after removing those lines VS restored the packages and built the solution correctly again.

提交回复
热议问题