NuGet Package restore IS enabled but I get an error saying it's not enabled

前端 未结 3 2153
醉话见心
醉话见心 2021-02-20 17:07

I have nuget package restore enabled in my solution. However, when I try to build the project, I get this error:

This project references NuGet package(s) that ar         


        
相关标签:
3条回答
  • 2021-02-20 17:22

    Please follow below mentioned steps:

    Step 1: Please enable Nuget Package Restore by right clicking on solution [as mentioned in below screenshot]

    Enable Nuget Package Restore

    Step 2: [Follow this if the issue / error is not resolved by following step 1] Still if you face the issue, please open .csproj file in notepad and check for the package path which might look like

    Package Path

    So your solutions directory structure will be like: \SolutionDirectory\

    Package Directory \SolutionDirectory\packages

    Project Directory \SolutionDirectory\ProjectName\ProjectName.csproj

    Please open this .csproj [in which you're getting error in notepad and search for packages path and update it to its relevant path.

    For e.g. my .csproj contained, if .csproj file contains ....\packages then update that path with ..\packages

    0 讨论(0)
  • 2021-02-20 17:30

    Try and see if this helps:

    in solution explorer, right click on the project name and select 'Enable Nudget package restore'

    also remember to rebuild each of your projects

    wait until it gets restored and run the project if it works fine

    0 讨论(0)
  • 2021-02-20 17:30

    I had already done what the blog post recommends (through the options menu) and it still didn't build.

    In the end I removed the Microsoft.Net.Http Nuget Package and Reinstalled it and that fixed it.

    0 讨论(0)
提交回复
热议问题