Question

Jan Van der Haegen on Wed, 21 Nov 2012 20:41:03


Unfortunately, I'm still running into the problem reported at this (meanwhile closed) post.

Whenever I try to create a new LightSwitch application, I get that Error: this template attempted to load component assembly ‘Microsoft.LightSwitch.Design.VSTemplateWizard, Version=10.0.0.0, Culture=neutral, PublickKeyToken=b03f5f7f11d50a4a', For more information on this problem and how to enable this template, please see documentation on Customising Project Template.

This does not occur when I open an already existing LightSwitch application.

Ugh.

Two workarounds:

* Repair on VS12: always works, but the repair itself takes about an hour and after a couple of days I run into the issue again.

* Reuse older LightSwitch projects :-)

Because of my laziness (don't judge me, my laziness is why I love LightSwitch in the first place ;-)) I stick with option 2, but of course would rather see this issue fixed / find a faster workaround than the repair VS12 option.

Additional information that might help:

My OS is still Win7 (not by choice) 

My laptop has two users, one domain user (day job) and one local user (community fun).

I have both VS10 as VS12 installed, and especially during my day job I open the large solution that we work on in VS10 while simultaneously opening a "scratchbook" console app in VS12 (because it's so much faster).

Any help / advice / tests to run / cold beer would be enormously appreciated.

Keep rocking LS!

Jan

Replies

Jan Van der Haegen on Wed, 21 Nov 2012 23:40:37


Not sure how this post ended up in the extensibility forum :-)

Xpert360 on Thu, 22 Nov 2012 09:38:15


Hi, this problem has not happened to me since September (Win 7 Ultiate VS20120 & VS2012 + everthing) and my main laptop (Win 8 only VS2012 pro) it has never happened (yet?).

I figured as you only notice it on creating a new project I am often too far past the point it happened to track back.

I have hyper-V vm's, checkpoints etc but not encountered it there either at a convenient time.

Repair always works for me too (usually over lunchtime!).

I do have an pristine VS2012 LS solution zipped just in case.


Dave Baker | Xpert360 blog | twitter : @xpert360 Opinions are my own. Please mark as answer if this helps solve your problem.


John Kears on Tue, 27 Nov 2012 23:12:15


Hi Jan,

This is one annoying issue and I had the same issue over and over because of a Windows update for TFS that was failing and after it attempted to install and failed it seemed to cause the same issue.  Like you a long reinstall fixed it but only to reappear as soon as the bloody Windows Update ran and failed.

I tried my best to resolve the Windows Update issue but eventually gave up and decided to bite the bullet and migrate from Windows 7 Ultimate to Windows 8 Pro. 

I went through the paid approach ($50) and it took close to 14 hours but I was pleasantly surprised that it worked with a few issues.  All my applications and settings migrated perfectly.

Once over to Win 8 this problem is no longer an issue for me. This is likely more to do with the fact I am not running the failing Windows Update. I see from your comments that you may not be able to upgrade, so look to see if there is a Windows Update that is failing.

On a side note, I really like Windows 8 Pro as my development environment. It did however break my local IIS setting which I still need to resolve.  It has Hyper-V client capabilities directly built into the OS (you do need to enable it to use it though).  One other concern I hit was the VPN client that use to work on Win 7 was not yet supported, so within an hour I created a Hyper-V Win 7 VHD and use that when I need to VPN.

I hope that helps you out.

Cheers

Johnny Larue




John Kears on Mon, 03 Dec 2012 22:53:41


Well bad news ... the issue has just returned to my Windows 8 development environment. 

This is really annoying!!!!

Robert Schoen [MSFT] on Tue, 04 Dec 2012 16:52:05


Hey, do you still have this occuring? 

Robert Schoen [MSFT] on Tue, 04 Dec 2012 17:00:25


Johnny

please can you do the following:

1.  Do you have the LightSwitch HTML 5 Client Preview 2 installed?

2. What  Lightswitch project "template" are you using that is hitting this?  Please provide the name of it that you see in the New Project dialog (eg. "LightSwitch Application (Visual Basic)")

3. How many project templates do you see under LightSwitch in the New Project dialog?

thanks!

John Kears on Tue, 04 Dec 2012 17:02:25


Hi Robert not sure if that question was directed towards Jan or myself... I just re-installed VS 2012 (takes like 2 hours) for like the umpteenth time so I could continue to develop LS within VS 2012 and the problem has gone away once again. 

The only way I know how to get rid of the issue is to run a re-install, but it is a great pain in the rear.

I really would like to see this resolved. 

What can we do to help you figure this out? 

John Kears on Tue, 04 Dec 2012 17:14:24


1. I do have the HTML 5 Client Preview 2 but... this issue occurred well before I installed the HTML 5 Client Preview 2.

2. Both the C# and VB.net templates fail to run when the issue is present. I don't recall if I tried the HTML templates when the issue occurred.

3. I normally see four templates (Application and Extension Library for both C# and Visual Basic) but as I currently have the Client Preview also installed, I see the two others for HTML C# and Visual Basic

Robert Schoen [MSFT] on Tue, 04 Dec 2012 17:22:46


I was really hoping to get a look at your new project templates.  I am suspecting that they are getting poluted/corrupted.  TO be clear, I am assuming you were getting the error that Jan mentioned in the first posting (load error for Microsoft.LightSwitch.Design.VSTemplateWizard, Version=10.0.0.0...).

If you encounter this again, can you please answer the following:

  • Go to your local template cache directory: ...\Microsoft Visual Studio 11.0\Common7\IDE\ProjectTemplatesCache\LightSwitch\1033\DesktopCSharpLightSwitchProjectTemplate.  With Notepad, open the the "LightSwitchProject.vstemplate" file and go to the bottom.  At the bottom you should see the element "<WizardExtension>" which contains assembly info for the VSTemplateWizard.  Please tell me what the "version" value is there. 
  • I suspect that you will see version "10.0.0.0" and not the expected "11.0.0.0". 
  • If you see "10.0.0.0" then please also go to the project non-cache at ...\Microsoft Visual Studio 11.0\Common7\IDE\ProjectTemplates\LightSwitch\1033\DesktopCSharpLightSwitchProjectTemplate\LightSwitchProject.vstemplate (open this file with notepad) and again tell me what version value you see for the VSTemplateWizard. 

John Kears on Tue, 04 Dec 2012 17:29:19


Yes it is the exact error that Jan reported as have many others...

I will report back what I discover.

Assuming that's what is happening, the next question is why and how do we prevent this?

Is there something we can run to revert out the invalid templates to the proper ones?

John Kears on Tue, 04 Dec 2012 17:57:28


Currently both template folders appear correct ...

Robert Schoen [MSFT] on Tue, 04 Dec 2012 18:37:18


Thanks Johnny,

I am not clear on the extra templates you are talked about earlier: "Application and Extension Library for both C# and Visual Basic".  Can you tell me where/how you got those templates?  Note - in your images supplied above I do not see those extra templates listed in the "cache or non-cache" folder?   

I am assuming you have both Lightswitch 2011 and VS 2012 installed here together on the same box. 

You mentioned "TFS" components and Windows Update - Do you know what TFS bits are attempted with updates?

Depends on where the "polution" is.  If it is "ONLY" in the TemplateCache folder (other folder is correct still), then you should be able to just run from an elevated (Admin) VS 2012 Command Prompt  the following command which will "rebuild" the template cache based upon what is in the "Non-cache" directory.  The command is "Devenv /setup".  

thanks

 

Robert Schoen [MSFT] on Tue, 04 Dec 2012 21:15:47


So the "template" stuff I listed above is likely not the cause.  Looking further...

Robert Schoen [MSFT] on Tue, 04 Dec 2012 21:41:26


Okay, we know of an issue where if you install VS2012 and then install our LightSwitch 2011 product that you will hit this exact error.   But in several threads we are seeing that users are hitting this issue over and over again even if they have installed LS 2011 and then VS 2012 second.   What seems to be happening here is somehow the LS 2011 setup is getting "rerun" in some fashion (maybe via windows update changes) which causes the below registry key to get overwritten back to the v10 version. 

SO, if you hit this issue please in the future, instead of running thru the long repair/reinstall of VS2012 and you do feel confortable making this change yourself, you can just open your registry under HKCR\.lsproj and change the "default" value from "VisualStudio.Launcher.lsproj.10.0" to "VisualStudio.Launcher.lsproj.11.0" as seen below.  This should take care of the problem.

John Kears on Wed, 05 Dec 2012 02:55:39


Thanks Robert I hope this resolves the issue... I will let you know if it does not!

As this is Jan's thread he can mark this as resolved.

Cheers

John Kears on Thu, 06 Dec 2012 01:18:54


Just wanted to report back that this issue did arise shortly after attempting to get the HTML Preview 2 install to work and your instructions to reset via the registry worked like a charm!

Thanks

Spursoft Solutions on Thu, 04 Apr 2013 15:01:01


God I luv these fourms.  Saved me tons of time.

sqlfans1 on Mon, 27 Jan 2014 15:19:35


Saved lot of time.

Thank you,