Copy Files to Project Folder with Visual Studio Project Template
I'm making a custom Visual Studio Project Template for a CSharp project and was wondering if there was a way to copy a dll from the template zip file to the new project file wi开发者_StackOverflow社区thout including the dll in the project files?
The idea is that the project references the dll, but I just dont want the developers to care about the assembly.
What I did was, created new template wizard i.e. by implementing IWizard interface. This article(http://msdn.microsoft.com/en-us/magazine/cc188697.aspx) will help you to get started with custom wizard.
Then in the RunStarted() method you will be able to get path to the current template like this
Path.GetDirectoryName((string)customParams[0])
Also you can get the path where the project is created using below code
replacementsDictionary["$destinationdirectory$"]
Once you have these values, do a normal file copy on the RunFinished() method
精彩评论