An odd error when adding items to toolbox in Visual Studio 2010

Ever got an error like this when trying to add a toolbox item?

image

Textual representation (for search engines):

—————————
Microsoft Visual Studio
—————————
Could not resolve mscorlib for target framework ‘.NETMicroFramework,Version=v4.1’.  This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted.
—————————
OK  
—————————

and here is another one:

error

—————————
Microsoft Visual C++ Runtime Library 
————————— 
Runtime Error!

Program: C:\Program File…

R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application’s support team for more information.
—————————
OK
—————————

The later one is really useful.

Note: It isn’t strictly linked to v4.1 – it happens with earlier versions as well.

Another side effect is that toolbox is somewhat corrupted, only certain tabs are loaded. But fear no more, here is the culprit and the workaround we found.

It turns out that there are problems when .net microframework is installed and its assemblies can’t be loaded.

Update (23.12.2011)

Microsoft wisely broke the link to the thread containing the solution – the solution thread has vanished into the black hole of the internet.
So, here is the solution as far as I remember :-):
Rename the files (or delete them) FrameworkList.xml which are installed in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETMicroFramework\v4.x\RedistList. Note that each .NET Micro Framework installs its own file in its own folder.

3 thoughts on “An odd error when adding items to toolbox in Visual Studio 2010

Leave a Reply