Installing the Prism Template Pack for Visual Studio 2010…

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:
“HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\ExtensionManager\EnabledExtensions”

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 modify the folder structure to reflect what you removed from the path. Mine looks like this:

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:

  1. Install the template pack
  2. Edit the registry key to shorten the path
  3. Modify the folders on your disk to reflect the new path
  4. 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.
  5. 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.

Cheers :)

About these ads
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

2 Responses to Installing the Prism Template Pack for Visual Studio 2010…

  1. Kalai says:

    It solved my issue. Great job….

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s