Reputation: 91233
In Visual Studio, I want to make a simple C++ project and export it out as a template, so I can use the template to start new projects to save me time. But the Export Template menu option is always grayed out. I've not once been able to click it.
Anyone know why? Anyone know how to accomplish what I need (besides the obvious "make a copy of an existing project in explorer")?
It seems like project templates should be a no-brainer feature for VS.
This seems to be the case for Visual Studio 2005, 2010 (I probably 2008 as well I haven't checked).
Upvotes: 9
Views: 12022
Reputation: 6260
There are some additional solutions suggested here (under the header "Template Creation Strategies) which may work, albeit I haven't personally tried any of them.
Upvotes: 0
Reputation: 10988
Anyone know how to accomplish what I need (besides the obvious "make a copy of an existing project in explorer")?
Don't just make a copy in explorer! Your project file will contain the same project GUID as the one you copied from. This may not immediately or ever become a problem but there are situations where you will have strange bugs. This occurs mostly (or only?) when you have multiple projects with the same GUID in the same solution. If you must, use the GUID generator to create a new unique GUID for the new project.
See also Detecting Projects with Duplicate GUIDS.
Upvotes: 3
Reputation: 2051
You can use the Visual C++ wizard architecture, which is designed for easy extensibility and customization. You can create a wizard using the Visual C++ Custom Wizard. After you create your wizard, you can configure it to generate the starter files you need for your projects.
For more information how to do this please refer to the following location: http://msdn.microsoft.com/en-us/library/bhceedxx(v=VS.80).aspx
Noticed that normal project template and VC++ project template are different
Let me know if you have any problems...
s
Upvotes: 4
Reputation: 9163
I didn't know about the Export Template feature, also by me it isn't grayed out in C# project, but there another solution, called Solution Factory.
http://solutionfactory.codeplex.com/
But I really need to test that Export Template feature.
Upvotes: 1