The type initializer for "Nuget.EnvironmentUtility" threw an exception

I am on my second computer with the same problem. I assume this is a combination of tools that I use in Visual Studio, but often get this error.

Install-Package : The type initializer for 'NuGet.EnvironmentUtility' threw an exception. At line:1 char:35 + get-project -all | Install-Package <<<< xamarin.forms + CategoryInfo : NotSpecified: (:) [Install-Package], TypeInitializationException + FullyQualifiedErrorId : System.TypeInitializationException,NuGet.PowerShell.Commands.InstallPackageCommand 

I ended up confused with uninstalling / reinstalling nuget, rebooting my machine and deleting configuration files until it works again. I never know for sure which part actually corrected it.

Has anyone else seen this? What are the right steps to solve?


Microsoft Visual Studio Professional 2013 update version 12.0.31101.00 4 Microsoft.NET Framework version 4.5.50938

Installed Version: Professional

Team Explorer for Visual Studio 2013 06177-004-0444002-02083 Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013 06177-004-0444002-02083 Microsoft Visual Basic 2013

Visual C # 2013 06177-004-0444002-02083 Microsoft Visual C # 2013

Visual C ++ 2013 06177-004-0444002-02083 Microsoft Visual C ++ 2013

Visual F # 2013 06177-004-0444002-02083 Microsoft Visual F # 2013

Visual Studio 2013 Code Analysis Spell Check
06177-004-0444002-02083 Microsoft® Visual Studio® 2013 Code Analysis Spell Check

Parts of the International CorrectSpell ™ Spelling Correction System © 1993 by Lernout and Hauspie Speech Products NV All rights reserved.

American Heritage English Dictionary, Third Edition Copyright © 1992 Houghton Mifflin Company. The electronic version is licensed from Lernout and Hauspie Speech Products NV. All rights reserved reserved.

Insights Tools Application for Visual Studio Package 1.0 Insights Tools Application for Visual Studio

ASP.NET and Web Tools 12.4.51016.0 Microsoft Web Development Tools includes the following components: Support for creating and opening ASP.NET Web Projects. Browser link: communication channel between Visual Studio and browsers Editor extensions for HTML, CSS and JavaScript page inspector: ASP.NET web project validation tool Forests: framework for building and running code generators Server Explorer extensions for Microsoft Azure Web sites publication : Extensions for publishing ASP.NET web projects to hosting providers, local servers or Microsoft Azure

ASP.NET 2012.2 Web Platforms and Tools 4.1.21001.0 For more information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET 2013 Web Platforms and Tools 5.2.21010.0 For more information, visit http://www.asp.net/

Common Azure Tools 1.3 Provides common services for using Azure Mobile Services and Microsoft Azure Tools.

JetBrains ReSharper Platform 6 Build 6.0.20141219.120158 on 2014-12-19 12: 56: 02Z JetBrains ReSharper Platform for Microsoft Visual Studio. For more information about the ReSharper Platform, visit http://www.jetbrains.com/resharper . Copyright © 2015 JetBrains, Inc.

Microsoft Azure Mobile Services Tools 1.3 Microsoft Azure Mobile Services Tools

NuGet Package Manager 2.8.60318.734 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/ .

PowerShell Tools 1.3 Provides file classification services using PowerShell

PreEmptive Analytics Visualizer 1.2 Microsoft Visual Studio extension for visualizing aggregated resumes from PreEmptive Analytics Product.

SQL Server Data Tools 12.0.41012.0 Microsoft SQL Server Data Tools

Windows Phone 8.1 SDK Integration 1.0 This package integrates the tools for the Windows Phone 8.1 SDK into menus and Visual Studio controls.

Xamarin 3.11.445.0 (5061f92) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android 5.1.0.115 (d23da369e436488f38c8ab8fe8a9ae7d9ea5256b) Visual Studio plug-in for developing Xamarin.Android.

Xamarin.Forms Intellisense 1.0 Provides intellisense for Xamarin.Forms in an XML editor.

Xamarin.iOS 8.10.0.0 (7741cc495ab0baf04ff0405d0604bc27f0ecae2e) Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration 1.0 Automatic Migration for Xamarin iOS Classic Projects for Unified

Xamarin.TestCloud.Integration 1.0 Early Xamarin Test Preview Cloud Integration

+5
source share
4 answers

I got this and solved it by closing ALL VS instances before re-opening the solution with the problem.

+8
source

We got the same problem several times and could not understand it. Having seen your list of installations, I believe that this should be a combination of Visual Studio, ReSharper and Xamarin, which I also installed.

I just don't want to give up my ReSharper!

edit: I saw an error or two, created for very similar problems related to the Xamarin Visual Studio plugin creating strange errors. The one I saw should be fixed or will be in alpha soon. Although I can’t say for sure whether he will consider this particular problem. If I find the error link again, I will post it here.

+3
source

I had the same problem, also using ReSharper and Xamarin. In my case, this was caused by an extension conflict. I removed all unnecessary extensions (in my case, everything about "Azure", "Advertising" and "pubCenter"), and now it works. While removing the Microsoft Advertising SDK is not a trivial task, suggest using a common uninstaller or similar programs.

+2
source

Updating the Azure SDK to the latest version (shown as updating under tools -> extensions and updates in the updates tab) allowed this for me.

+2
source

All Articles