Corrupt Visual Studio 2013 Environment?
The other day whilst testing AIDE for Visual Studio 2013 I came across this problem. At first I thought it was something similar to another VS2010/Vs2012 .LSPROJ launcher problem (Error: this template attempted to load component assembly) but that turned out not to be the case.
I tried not to panic as my plans for the day started to fall apart. It was most peculiar. Repairing VS2013 crossed my mind but you don’t embark on that route unless you are really have no other option and it has no guarantee of fixing your problem. I had three VS2013 instances running LightSwitch projects with HTML client and they continued to work fine. Try to open another LightSwitch project, #fail. What next? Close one Vs2013 instance, then restart and load the project, #fail. Close everything, reboot, open VS2013 project fail!
Copy project to another machine, open, #success! So as expected projects are ok and not corrupt.
Try something crazy? Debug VS2012 AIDE project running VS2013 experimental instance, load LightSwitch project, #success!
So experimental instance good, standard development instance bad.
Let us walk through the scenario of what happened for me and how to resolve the problems. To reproduce, try opening three LightSwitch projects within a few seconds one after another. This multi-tasking and multi-threading Visual Studio 2013 start-up just does not work well and the best advice is don’t do it. This likely applies to two or more solutions containing other project types, it is just that I was using LightSwitch projects.
The ‘Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectPackage, Microsoft.VisualStudio.ProjectSystem.VS.Implementation, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file ‘…VisualStudio\12.0\ActivityLog.xml’.
This generic message turns out to not be very helpful. Then when you try to open a LightSwitch project:
This looks like this in solution explorer:
The problem stemmed from file contention when more than one Visual Studio instance is loading. Fortunately, the issue can be resolved by encouraging Visual Studio to rebuild its component cache.
Locate the ‘Microsoft.VisualStudio.Default.cache’ file in ‘ComponentModelCache’ directory and delete it. Restart one instance of Visual Studio 2013 and it rebuilds the cache and all is well. It is worth noting that there are other details cached here, such as SharePoint and LightSwitch ManifestCache files. You can safely clear out these files too should they ever cause similar Visual Studio environment issues.
I wish I had known about this back when using Visual Studio 2012 lots and resorting to ‘Repair’ several times.
AIDE 2013 for Visual Studio
AIDE 2013 is the market leading set of productivity power tools for Cloud Business and LightSwitch applications. The only supported way to clone and import/export screens! Local backup/restore and much more. Visualize hard-to-access metadata to complement working with the standard LightSwitch designers.
Failed upgrades, unloadable projects, old extensions, AIDE for LightSwitch will be there to help you through! Xpert360 consultants have real-world experience of reconstruction and resurrection of corrupt projects. Contact us if your need help troubleshooting your LightSwitch projects.
Company information: Xpert360 Ltd, founded in 2009, based upon three decades of IT experience, is an Independent Software Vendor and Custom Solution Provider based in the United Kingdom.
“Xpert360 Lightning“, “AIDE for LightSwitch“, “AIDE 2013 for Visual Studio” are trademarks of Xpert360 Ltd, copyright 2012 – 2014.