I am getting the error The type initializer for 'Nuget.Proxy Cache' threw an exception when trying to connect to the Nuget offcial Package source. I am behind a corporate network, however I doubt the issue is connectivity.
Any ideas?
I have the same issue. I used the following powershell command in the Package Manager Console to help me find the source:
try {
update-package nunit}
catch{
$error| Format-List * -Force
$Exception = $error[0].Exception
for ($i = 0; $Exception; $i++, ($Exception = $Exception.InnerException))
{ "$i" * 80
$Exception |Format-List * -Force
}
}
In my case the underlying error was:
System.DllNotFoundException: Unable to load DLL 'rasapi32.dll': Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Attaching a debugger and then looking at the NuGet source code it's being thrown when NuGet tries to see if the solution is in source control. The error gets thrown by the EnvDTE interface, which is exposed by visual studio.
I'll update this if I actually solve the problem, but hopefully this is a start.
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