I am unable to use the Solution.GetProjectTemplate() method for my own
custom project template.
When I made the template, using the VS2005 "Export Template" command,
it was saved in the following directory:
C:\Documents and Settings\<username>\My Documents\Visual Studio
2005\Templates\ProjectTemplates
the zip file for the template has spaces in it: "My own template.zip" .
Furthermore, this location is the value set for the VS Tools > Options
> Projects & solutions > VS user project templates location option.
Now this is how I use GetProjectTemplate() in my code:
MyTemplatePath = soln.GetProjectTemplate("My own template.zip","");
The problem seems to be in the second paramaters. I've used the
following values for it, with the following results:
"CSharp" -> File not found.
"" (empty) -> File not found
"Visual C#" (which is a subdirectory of the custom templates default
folder given above) -> still no luck.
MSDN doesn't specify what to use for the second argument when the
template in question is a custom user template place in the directory
given above.
What am I doing wrong, and how do I do it right? I would greatly
appreciate help on this matter as it is delaying the work. Thanks in
advance.
Data.
Dustin Campbell - 18 May 2006 14:49 GMT
> C:\Documents and Settings\<username>\My Documents\Visual Studio
> 2005\Templates\ProjectTemplates
Is this a C# template? If so, have you tried moving it to:
C:\Documents and Settings\<username>\My Documents\Visual Studio 2005\Templates\ProjectTemplates\Visual
C#?
Best Regards,
Dustin Campbell
Developer Express Inc
datamodel - 18 May 2006 14:58 GMT
Yes it is a C# template, and I did try to move it to the "Visual C#"
subdirectory. Still no luck.
BTW, I tried the following strings for the second argument of
GetProjectTemplates() :
"CSharp", "Visual C#", and "" . Still no luck.