Click here to Skip to main content
15,903,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In VS2015 I could install nuget packages, a packages folder and a packages.config file were automatically created in my solution. Also references were automatically added.
In VS2017 however I can't install any nuget package, I get an error saying "Install failed, rolling back." and "Failed to add reference to *packagename*, DLL not registred." I tried the packages webview2, newtonsoft json and restsharp but none worked. Here's the
packetmanager output
The packages are downloaded into the global packages folder and unzipped but they are not installed in my project, no packages folder, packages.config or references are added.

What I have tried:

I first tried browsing the Manage NuGet Packages and then tried the Package Manager Console but to no avail.
I also tried manually adding the dll references via the reference manager but then I can't access Manage NuGet Packages anymore:
Help is much appreciated, this has been bugging now for weeks.
Updated 15-Dec-22 2:08am
Member 15627495 12-Dec-22 10:43am    
did you place your dll in the project folder ?
Member 15752716 12-Dec-22 10:56am    
You mean when I add the references manually ? I just refered to the folder in the global packages folder.
Richard Deeming 14-Dec-22 5:10am    
WebView2 is a special case. You need to have a compatible version of MS Edge installed before you can install the package. The documentation refers to installing the beta, dev, or canary build.

If you're getting the same error installing Newtonsoft.Json, then you may need to repair your Visual Studio installation.
Richard Deeming 15-Dec-22 9:02am    
Responding to the comment in "solution" 1:

TYPE_E_LIBNOTREGISTERED just means a type library isn't registered properly. It's nothing to do with Office.

If you're getting that error every time you try to install a NuGet package, then there's something wrong on your computer. Try completely uninstalling all versions of Visual Studio and then reinstalling the one you want to use.[^]

1 solution

@Richard Deeming:
Webview2 isn't the problem, I downloaded this example and it works just fine.
I now downloaded VS2019 but I get the same error: DLL not registred.
When I look up the error "Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)" google says it's an environmental error due to bad MS Office registry entry. So I uninstalled Office, but the error persists.
Not sure what to do now.
Share this answer
Richard Deeming 15-Dec-22 8:58am    
If you want to reply to a comment, click the "reply" button next to the comment and reply to it. Do not post your reply as a "solution" to your question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900