Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, May 15, 2019 5:26 AM
I have cloned a .net project from Github. When i am trying to build the project getting following error :
"
Severity Code Description Project File Line Suppression State
Error NuGet Package restore failed for project Application\BEL.FeedbackWorkflow: Unable to find version '1.5.2' of package 'WebGrease'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ Package 'WebGrease.1.5.2' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\.
https://api.nuget.org/v3/index.json: Error downloading 'WebGrease.1.5.2' from 'https://api.nuget.org/v3-flatcontainer/webgrease/1.5.2/webgrease.1.5.2.nupkg'.
Access to the path 'C:\Users\cloverspd1\nuget\packages\webgrease\1.5.2\tools\WG.exe' is denied.
. Please see Error List window for detailed warnings and errors.
"
All replies (9)
Wednesday, May 15, 2019 8:25 AM
Hi Ganesh,
Welcome to MSDN forum.
The error message indicates the restore of the WebGrease Package, please try tips below to resolve it:
1.Go Tools=>Nuget Package Manager=>Package Manager Settings, make sure we enable the restore settings and click 'OK':
2. Go Solution Explorer, right-click the solution name and click "Restore Nuget Packages" , then rebuild the solution or project to check if it helps.
3. If all above can't work, I suggest you right-click the project and choose manage nuget package, then uninstall the WebGrease 1.5.2 package. After that in Browse search the 1.5.2version of WebGrease and reinstall it again.
Also, if the .net project you cloned from github is an open-source and public repository, could you please share the link or the project name so that I can reproduce same issue and check it directly.
Any update about this issue please feel free to contact me. A feedback if my answer is helpful or not would be expected:)
Best Regards
Lance
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].
Wednesday, May 15, 2019 9:56 AM
Hey Lance for response. I have already tried option 1 and 2. I went for 3rd one. But there is no option to uninstall that nuget. One popup is coming and telling to restored the missing nuget packages. When i click on restore, after some time following error occures. Its not open source project. My colleague not facing the same problem. she is woring on visual studio 15 professional. i have recently installed vs 19. shall i move to vs15 then?
Wednesday, May 15, 2019 10:15 AM
Hi Ganesh,
Do you mean you can't find the package in installed tab like below?
If you can't find it there, right-click project name in solution explorer, choose unload project, again right-click project name, choose edit xx.csproj, check if in it exists a script like this:
<ItemGroup>
<PackageReference Include="WebGrease">
<Version>1.5.2</Version>
</PackageReference>
</ItemGroup>
If it exists, delete it. Then use the Nuget Manager to find the webGrease and download the 1.5.2 version you need.
In addition:
1.Please make sure the error message comes from this project.
According to your pic, there are several projects in the solution, every project has its corresponding nuget packages, you can build the project(right-click project and choose build) one time instead of build solution to check where the error message comes.
2.According to:"access to xxx is denied", you can run vs as admin to check if it helps.
Best Regards
Lance
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].
Wednesday, May 15, 2019 10:22 AM
I have unloaded the project. But above given script is not present. will problem resolve if i move to vs 15?
Wednesday, May 15, 2019 10:44 AM
Hi,
>>I have unloaded the project. But above given script is not present.
After that reload the project.
1.Open nuget package manager, in Installed tab, it the package exists, uninstall it
2.Check the references, if exists the reference to WebGrease, remove it
3.Check the packages.config file, remove below content if they exists:
For now, we can make sure we've removed it successfully.
According to your pic, the project uses packages.config format, so Go Tools=>Nuget Package Manager=>make sure you choose the "Packages.config" format, you should restart vs(run as admin) to make it work.
After all above, use nuget manager to install the 1.5.2 version package, check if it installs successfully.(If it succeeds, the reference would be added to the reference node)
Build the project to check if it helps.
>> will problem resolve if i move to vs 15?
Not sure, but in vs2019, the format by default is packagereference instead of packages.config in your project, so I suggest maybe you can change the format set and restart vs(run as admin) to resolve it.
And as what i mentioned above, does this project comes from a public and open-source repo, if so you can share the details about it, I'll download and test for you.
Best Regards
Lance
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].
Wednesday, May 15, 2019 11:45 AM
This project is not open source. So i cannot share this with you.
Thursday, May 16, 2019 7:38 AM
Hi Ganesh,
Sorry for the delay and apologize for not observing that's a private repo.
I've re-checked the issue again but no luck to reproduce the issue. Some possibility may result in the failure:
1.According to the error message "error downloading...", I've checked the url is valid and we can download the xxx.nupkg from that link. So I'm assuming if the network makes this difference, or maybe some third-party software or firewall prevent vs from downloading the package for you, which causes the failure of restore.
2.Since it works well in your colleague's vs2015(which uses packages.config to manage nuget packages), but in vs2019, it uses packagereference by default. I suggest you change the format from packages.config to packagereference to check if it helps.
My Suggestion is:
1. Since we've done many changes to the project, I suggest we delete the modified project, and clone the new clean one from github again (Download the complete solution)
2. Reset your vs settings of vs2019(Go Tools=>Import and Export Settings to reset your settings)
3. Change to Packages.config format(Go Tools=>Nuget Package Manager=>Packages.config), restart vs to make the changes take effect(Run as Admin)
4. Turn off your firewall software temporarily, check if restore can work
5. If same issue persists , then you can try right-click the packages.config file, choose migrate Packages.Config to PackageReference
Also, maybe you can get some help from this issue.
Any update please feel free to contact me.
Sincerely
Lance
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].
Tuesday, May 21, 2019 1:42 AM
Hi friend,
Any update for this issue? Please let me know if it is unblocked for you. If the issue persists, feel free to contact us. And if my reply is helpful, could you please mark it as answer so that I can close this thread for you.
Have a nice day!
Lance
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].
Monday, November 18, 2019 1:49 AM
Hi,
It is due to incorrect package source. Go to Tools -> Options -> Nuget Package Manager -> Package Source ->
Click the Plus sign to add a new source:
Name: Microsoft and .net (whatever)
Source: https://www.nuget.org/api/v2/.
Click [OK] to save changes and you should be all good.
Agha Usman Ahmed http://www.aghausman.net