So, I wanted to have a play with the Prism templates that David Hill made available to the community and so I grabbed them from his site and installed them.
Cool! Here we go I thought…File -> New -> Project -> Visual C# -> Prism -> ONLY ONE TEMPLATE!!?? What DA!?
Close VS2010 reopen and try again…same result.
OK -uninstall, then re-install…same result :(
So, I had a look on the post and it seemed others were having similar problems.
After a bit of investigation I think I understand whats happening. It seems that the path is too long and when the templates are getting installed by the Prism.TemplatePack.RC.vsix package it tries to write the files to the expected locations and fails because of the path limit is being exceeded. In my case the path to the “Prism.Shell.Silverlight.zip” folder was 244 characters long before any files or folders were created in it.
This might explain why some people are getting the problem and others aren’t.
So, we need to shorten the install path somehow.
Here’s what to do:
After installing the templates (and before you goto File -> New -> Project) if you look in the registry at this key:
you will see the a key for the Prism Templates. Somthing like:
Value Name: “Prism.TemplatePack.4RC.<SOME GUID>,1.0″
Value Data: “C:\Documents and Settings\<PROFILE NAME>\Local Settings\Application Data\Microsoft\VisualStudio\10.0\Extensions\David Hill\Prism Template Pack for WPF and Silverlight 4.0 RC\1.0\”
This is where we can shorten the path. I changed mine to:
“C:\Documents and Settings\<PROFILE NAME>\Local Settings\Application Data\Microsoft\VisualStudio\10.0\Extensions\Prism Template Pack 4.0 RC\1.0\”
Now run vs2010; go to File -> New -> Project (at this point vs2010 will chug away for a few seconds -its actually unzipping the template files and putting them on the disk at the location specified in the registry) and you should see all the templates!
So, here’s the recap:
- Install the template pack
- Edit the registry key to shorten the path
- Modify the folders on your disk to reflect the new path
- Open vs2010 then go to File -> New -> Project at this point vs2010 will chug away for a few seconds -its actually unzipping the template files and putting them on the disk at the location specified in the registry.
- Goto Visual C# -> Prism -> and there you should see all 6 templates.
So thats it. let me know in the comments how it worked out for u.