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=18.104.22.168, 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.
Thanks a lot! I’ve found your blog entry only after repairing VS (to no avail). It seems the component cache gets corrupted every couple of days without reason (no extension updates installed or so). Very sad.
Hi Phillip, do run simultaneous multiple copies of Visual Studio like me?
Yes, I do indeed from time to time.
Starting 2 x Visual Studio I can easily reproduce the.jsproj problem. Also seen VS global settings file corrupt too!
Pingback: LightSwitch Community and Content Rollup–March 2014 (+//build/) - Visual Studio LightSwitch Team Blog - Site Home - MSDN Blogs
You didn’t say where to find this folder.
Hi Simon, it is in the image of explorer 🙂 I did notice it not in the text of the blog, I’m a bit mischevious.
I mischeviously only made it available in the explorer image 😉
Hi Simon, I mischievously left it in the explorer picture 😉
So it is, not that I can read it without clicking on the image.
Anyway, it would have been nice if this trick would have worked for me today when the update to SSDT for SQL Server 2014 has stopped LightSwitch projects from loading, but it didn’t. So, I’m going to have to remove and reinstall Visual Studio, AGAIN.
Good luck with that. I’m only trying SSDT in a VM been burned many times on that stuff before in VS.
thank you so much this saved hrs