Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / May 2006

Tip: Looking for answers? Try searching our database.

SOS How do I use GetProjectTemplate() with custom templates?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
datamodel - 21 May 2006 12:00 GMT
I get an error that the template files are not found.

I use these syntaxes for the GetProjectTemplate() call:

MyTemplatePath = soln.GetProjectTemplate("My own template.zip","");
MyTemplatePath = soln.GetProjectTemplate("My own template.zip","Visual
C#");
MyTemplatePath = soln.GetProjectTemplate("My own
template.zip","CSharp");

None of them work. Please SOS !!!
dave@incdev.com - 31 May 2006 10:11 GMT
> I get an error that the template files are not found.
>
[quoted text clipped - 7 lines]
>
> None of them work. Please SOS !!!

Well, this works but there may be a better way....
I'm assuming you want to call AddFromTemplate.

guess what - if you dont put your template in a zip file (or expand the
zip file you got when you exported the project you used to make the
template)

and pass the file name of the .vstemplatefile as the first parameter -
it works.

e.g. <path to your expandedtemplate>\<your template>.vstemplate

you can sort of make GetProjectTemplate to work... If you

put your template in the
My Documents\Visual Studio 2005\Templates\ProjectTemplates\Visual C#
directory

use it by hand to make a new project from Fle New project in the visual
studio menus, close the new solution BUT NOT visual studio.

If you then run your wizard in the same ide GetProjectTemplate will
work - but look at the return value - it's for the .vstemplate file and
the path is a temp cache directory that Visual Studio has expanded the
template into - the .zip bit in the path is NOT a zip file but a
directory.

Oh. and the docs are misleading - you can just refer to the .csproj
file in AddFromTemplate and it still works and better yet it does
return a reference to the project instead of NULL. (wont run any fancy
replacements though)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.