Ever got an error like this when trying to add a toolbox item?
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.
and here is another one:
Microsoft Visual C++ Runtime Library
Program: C:\Program File…
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application’s support team for more information.
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.
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.