Hi @Mehdi Khaleghian | MOQdigital ,
Apologies for the delayed response. Can you please follow the steps below and see if it resolves this issue?
- Open Visual Studio, go to "Debug" --> "Options.."
- Search for "Nuget Package Manager" --> General
- Click on "Clear All Nuget Cache(s)" and wait for it to clear. (If it throws error, please note the error, and close all running instance of Visual Studio/applications that might be using the package manager). This would ensure that the local cache is cleared properly. You may get more details of caches being cleared by looking into "Output" window after performing this step.
- After the step above completes, go to "Debug" --> "Options.." again.
- Under "Nuget Package Manager" --> Package Sources. Make a copy of the sources available there (Name and URL) in notepad. (This should help get rid of any non-printable characters which might be present in the copied string)
- Delete all sources and click "OK". (This is to ensure that removal gets persisted, in case there was an error saving the sources originally due to non-visible characters etc.)
- After the step above completes, go to "Debug" --> "Options.." again.
- Under "Nuget Package Manager" --> "Package Sources", add the sources with details from notepad copied in step 5 above.
- Click on "OK"
Check if you can build the project successfully.
In addition to the steps mentioned above, please ensure that "ASP.NET and web development" and "Azure Development" workloads are installed for this instance of Visual Studio. You can verify it by
- "Start" --> "Visual Studio Installed"
- Locate your version of VS in here (16.11.3) --> click on "Modify". If the above 2 workloads are not present, please select them and install.
In case you still run in to similar issues, you may try running dotnet restore
with detailed verbosity (-v d
parameter) to examine the error details. More details available here. Please let me know if you have any questions.
Please 'Accept as answer' if it helped so that it can help others in the community looking for help on similar topics.