#
Constructor
I had a few hours spare today so I looked at the possibility of creating a Visual Studio Project Template for Cuyahoga Modules. This would enable the developer to (I will make this really short, there are details missing but you will get the idea):
from within Visual Studio and get the complete bare bones module appear, complete with install scripts and post build etc...
I started with just as basic a module as I could (complete with Domain, Data Access, Module Class, POCO etc...). Complete but basic.
Then I export to template and this was fine. Then there was the issue if replacing $tokens$ with custom parameters. Some of these are: $itemname$, $machinename$, $projectname$, $registeredorganization$, $rootnamespace$ etc... You may have used these before.
You can also hardcode parameters by adding elements within the TemplateContent section in the .vstemplate file like this:
Since there are only limited available as default and hardcoding them both missed the point and was not flexible enough, I had to create a wizard to run within Visual Studio. :s
To do this requires you to build a Class Library to place in the GAC (this may be optional) that will be the form that collects the user input and then uses it to generate the required project files on the fly (replace the $tokens$ etc...)
In short (VERY short) you implement the Visual Studio IWizard interface inside your class lib, create a form that passes the input to it, build the .dll and put it in the GAC and add a WizardExtension section to the .vstemplate (this tells the devenv the lib to call when you 'New Project'.
So I did this... and.... it works. It needs cleaning, but it would save a lot of boredom getting the foundations of a module down.
I am really glad I had a look at this. :) It also gave me a bit more of an understanding od the development environment also. It is good to learn new things, even better if it will save time in the future.
If it is of help? I may post the project.
right click > Add > New Project > Cuyahoga Module
from within Visual Studio and get the complete bare bones module appear, complete with install scripts and post build etc...
I started with just as basic a module as I could (complete with Domain, Data Access, Module Class, POCO etc...). Complete but basic.
Then I export to template and this was fine. Then there was the issue if replacing $tokens$ with custom parameters. Some of these are: $itemname$, $machinename$, $projectname$, $registeredorganization$, $rootnamespace$ etc... You may have used these before.
You can also hardcode parameters by adding elements within the TemplateContent section in the .vstemplate file like this:
< TemplateContent>
< CustomParameters>
< CustomParameter Name="$Parameter1$" Value="Value1"/>
< CustomParameter Name="$Parameter2$" Value="Value2">
< /CustomParameters
etc...Since there are only limited available as default and hardcoding them both missed the point and was not flexible enough, I had to create a wizard to run within Visual Studio. :s
To do this requires you to build a Class Library to place in the GAC (this may be optional) that will be the form that collects the user input and then uses it to generate the required project files on the fly (replace the $tokens$ etc...)
In short (VERY short) you implement the Visual Studio IWizard interface inside your class lib, create a form that passes the input to it, build the .dll and put it in the GAC and add a WizardExtension section to the .vstemplate (this tells the devenv the lib to call when you 'New Project'.
So I did this... and.... it works. It needs cleaning, but it would save a lot of boredom getting the foundations of a module down.
I am really glad I had a look at this. :) It also gave me a bit more of an understanding od the development environment also. It is good to learn new things, even better if it will save time in the future.
If it is of help? I may post the project.