Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Custom UnfoldTemplate
 

Custom UnfoldTemplate

I have a class derived from UnfoldTemplate that I am attempting to utilize in a '.vstemplate' file. The class resides in a seperate assembly from the GAT, the assembly is strong named and references no assemblies other than what is required for type resolution of UnfoldTemplate. All attempts to register the GAT report the following exception:

An exception occurred during the Install phase.
Microsoft.Practices.RecipeFramework.RecipeFrameworkException: Unexpected error loading template file name MySolution.vstemplate. Make sure that the template is well formed and try again.
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.TemplateMetaData.ReadTemplate()

// Exception stack trace omitted for brevity

The inner exception System.ArgumentException was thrown with the following error message: The template does not have the correct WizardExtension data..
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.TemplateMetaData.ReadTemplate()

I've used the ReflectionHelper class located in the Microsoft.Practices.Common assembly to verify that the Type can be loaded based on the following XML fragment:

<Assembly>MyRecipeFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9fab3f7fbe0827fd</Assembly>
<FullClassName>MyRecipeFramework.Templates.UnfoldTemplate</FullClassName>

I am at a loss as to what could preventing the GAT from successfully registering. Any help would be greatly appreciated.
farproc2000  Thursday, May 25, 2006 9:19 PM
If you reflector the Microsoft.Practices.RecipeFramework.VisualStudio.Templates.TemplateMetaData.ReadTemplate() method, you will find near the bottom that all we're doing is verifying that we can load the type, and that the type can be assigned to UnfoldTemplate.

Verify that that is the case with your assembly (i.e. it's deployed to IDE\PublicAssemblies folder) and it should work.
kzu  Monday, May 29, 2006 3:11 AM
If you reflector the Microsoft.Practices.RecipeFramework.VisualStudio.Templates.TemplateMetaData.ReadTemplate() method, you will find near the bottom that all we're doing is verifying that we can load the type, and that the type can be assigned to UnfoldTemplate.

Verify that that is the case with your assembly (i.e. it's deployed to IDE\PublicAssemblies folder) and it should work.
kzu  Monday, May 29, 2006 3:11 AM
Daniel,
Using Reflector, I examined the code in the ReadTemplate method and verified the issue with the following trimmed down code:

string assemblyName = "MyRecipeFramework.Templates.UnfoldTemplate, MyRecipeFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9fab3f7fbe0827fd";
Type type = ReflectionHelper.LoadType(assemblyName);
if (typeof(UnfoldTemplate).IsAssignableFrom(type))
{
Console.WriteLine("It's there dude");
}

This code writes the helpful message everytime so again I'm left to ponder: 'what the heck is going on here?'. I did try your suggestion about the PublicAssemblies folder, and I know Visual Studio 'finds' it because I attempted to delete it and received a 'file in use' exception.


farproc2000  Thursday, June 01, 2006 3:52 PM
I have the same problem..any solution.?

My class derive from UnfoldTemplate and it`s in C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies folder.

this is the code in the template:

<WizardExtension>
<Assembly>CustomWizards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d971450e3c8ea08</Assembly>
<FullClassName>CustomWizards.CustomUnfoldTemplate</FullClassName>
</WizardExtension>

Thanks.
N.S.

System Computer Analyst
Nicolas Sampietro  Wednesday, January 07, 2009 8:18 PM

You can use google to search for other answers

Custom Search

More Threads

• Null reference Exception after upgrade to GAX 1.2
• VS2008 Standard vs Professional
• Custom Guidance Package Deployment
• Impossible to uninstall GAT
• Argument in a Recipe, how to access them from a custom page
• Guidance actions are gone
• Starting VS2008 SP1 Beta1 In Experimental Hive Fails with Recipe Framework Error
• Another uninstall problem of GAT/GAE
• 1 GAT Solution but 2 different Solution Templates
• Microsoft.Office.Interop.Excel.Applicatio not defined