When I try to add a new package with NuGet I get the error
Error HRESULT E_FAIL has been returned from a call to a COM component.
I've checked several posts about this and tried alot of solutions but can't seem to find the issue. It might be worthing noting that I moved and renamed my project at some point and the copy I left behind still functions with NuGet packages.
After looking into it some more I found this error:
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at EnvDTE.SourceControl.CheckOutItem(String ItemName)
What I've tried already:
Deleting the user.csproj and/or .suo
Checking all project references and if they are located correctly
Deleting Temp files
Deleting bin & obj folders
Deleting the ProjectTemplatesCache
Checking the project web properties
Restarting VS, cleaning and rebuilding the project (always run in admin).
Deleting the ComponentModelCache
Deleting packages folder content and restoring NuGet packages in solution.
Check-in all pending changes to version control before attempting to add a new NuGet package.
I just had this 01.08.2019 with both Visual Studio 2019 and Visual Studio 2017. I've tried the following solutions which did not work:
What worked for me is simply deleting the .vs
folder and also deleting everything from the packages folder of the solution I was using. Then I ran Restore NuGet Packages
on the solution level.
Checking in all pending changes and then performing a 'check-out for edit now' did the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With