{"id":3305,"date":"2011-12-27T12:35:29","date_gmt":"2011-12-27T04:35:29","guid":{"rendered":"http:\/\/www.sharepointboost.com\/blog\/?p=3305"},"modified":"2023-07-31T11:40:01","modified_gmt":"2023-07-31T03:40:01","slug":"how-to-create-your-sharepoint-visualstudio-multiple-project-template-the-whole-solution","status":"publish","type":"post","link":"https:\/\/www.boostsolutions.com\/blog\/how-to-create-your-sharepoint-visualstudio-multiple-project-template-the-whole-solution\/","title":{"rendered":"How To Create Your SharePoint VisualStudio Multiple Project Template (The Whole Solution)"},"content":{"rendered":"<p>Are you wasting your time to create a SharePoint foundation solution architecture?<\/p>\n<p>Let&#8217;s assume you are a software architect, and you have to create the template for a new product. It is a repetitive task and will cost you a lot of time for the following:<\/p>\n<p>You shall define the layers for your solution, such as Presentation Layer, Domain Layer, Data Access Layer, Service Layer, Infrastructure Layer and so on. In other words, you should create different projects in VisualStudio and build the projects relationships.<\/p>\n<p>You should keep the same technology, otherwise when an employee is transferred from one product team to another, he will have to study a new technology (eg: one product team using Spring.NET IOC container and the other product team using Castle IOC container. What a bad message! The employee should master two different IOC framework).<\/p>\n<p>Regarding to coding, you should reference the infrastructure assembly (Eg: IOC, AOP, Unit Test framework and so on), attach the xsd schema for xml configuration file input intellisense, and keep the same technology and code structure for all products.<\/p>\n<p>What happens today?<\/p>\n<p>You can create your SharePoint VisualStudio multiple project (the whole solution) template now.<\/p>\n<p>Using it, when you want to start a new product, you can create your foundation code structure with the template. The whole creation process only takes a few seconds, finally you can put away the repetitive work and do something productive.<\/p>\n<p>Preview of the Solution Template solution<\/p>\n<p><!--more-->The &#8220;Solution Template&#8221; solution is as follows:<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic1-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3306 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic1-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"382\" height=\"588\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic1-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 382w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic1-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-194x300.png 194w\" sizes=\"(max-width: 382px) 100vw, 382px\" \/><\/a><\/p>\n<p>There are three projects in the solution.<\/p>\n<ol>\n<li>Landpy.SolutionTemplate.TemplateContent is the content of the solution template (it includes the code, xsd, reference assembly, project configuration, SNK files and so on)<\/li>\n<li>Landpy.SolutionTemplate.VSIX is a Extensibility VSIX project, it will generate vsix file which can be installed as a VisualStudio extensibility. You install the extensiblity, then you can create your own solution as the build-in template.<\/li>\n<li>Landpy.SolutionTemplate.Wizard is the project to dynamically generate some code such as assembly info or namespace. It is always a WinForm project like a wizard when you create the solution with the template.<\/li>\n<\/ol>\n<p><strong>How to use the Solution Template<\/strong><\/p>\n<p><strong><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic2-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3307 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic2-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"557\" height=\"167\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic2-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 557w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic2-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x89.png 300w\" sizes=\"(max-width: 557px) 100vw, 557px\" \/><\/a><br \/>\n<\/strong><\/p>\n<p>Step one: Double click the Landpy.SolutionTemplate.VSIX.vsix file to install the extensibility.<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic3-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3308 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic3-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"464\" height=\"348\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic3-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 464w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic3-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x225.png 300w\" sizes=\"(max-width: 464px) 100vw, 464px\" \/><\/a><\/p>\n<p>Step Two: Click the Install button.<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic4-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3309 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic4-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"464\" height=\"348\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic4-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 464w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic4-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x225.png 300w\" sizes=\"(max-width: 464px) 100vw, 464px\" \/><\/a><\/p>\n<p>Step Three: The extensibility has been installed, click Close button.<\/p>\n<p>Note: You should restart your VisualStudio to load the extensibility.<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic5-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3310 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic5-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"557\" height=\"341\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic5-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 557w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic5-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x183.png 300w\" sizes=\"(max-width: 557px) 100vw, 557px\" \/><\/a><\/p>\n<p>Step Four: Open Visual Studio, then click the menu File-&gt;New-&gt;Project, Select the template which will be installed in the last step.<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic6-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3311 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic6-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"558\" height=\"297\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic6-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 558w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic6-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x159.png 300w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic7-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3312 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic7-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"558\" height=\"297\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic7-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 558w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic7-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x159.png 300w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/p>\n<p>Step Five: With the wizard create the new solution. Only takes you a few seconds.<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic8-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3313 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic8-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"248\" height=\"209\" \/><\/a><\/p>\n<p>Solution Structure<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic9-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3314 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic9-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"483\" height=\"168\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic9-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 483w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic9-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x104.png 300w\" sizes=\"(max-width: 483px) 100vw, 483px\" \/><\/a><\/p>\n<p>Assembly info is based on the wizard input.<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic10-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3315 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic10-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"483\" height=\"367\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic10-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 483w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic10-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x227.png 300w\" sizes=\"(max-width: 483px) 100vw, 483px\" \/><\/a><\/p>\n<p>CS file is based on the wizard input.<br \/>\nNote: If you want to uninstall the extensibility, you should open VisualStudio and click the menu Tools-&gt;Extension Manager&#8230;<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic11-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3316 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic11-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"558\" height=\"341\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic11-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 558w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic11-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x183.png 300w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/p>\n<p>Click the Uninstall button to uninstall the extensibility.<strong> <\/strong><\/p>\n<p><strong>How to develop the Solution Template?<\/strong><\/p>\n<p><strong><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic12-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3317 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic12-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"558\" height=\"341\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic12-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 558w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic12-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x183.png 300w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/strong><\/p>\n<p>Step One: Create a content project:<\/p>\n<p>For multiple project template, you should modify the vstemplate file as follows:<\/p>\n<p>&lt;?xmlversion=&#8221;1.0&#8243;encoding=&#8221;utf-8&#8243;?&gt;<\/p>\n<p>&lt;VSTemplateVersion=&#8221;2.0.0&#8243;Type=&#8221;ProjectGroup&#8221;<\/p>\n<p>xmlns=&#8221;http:\/\/schemas.microsoft.com\/developer\/vstemplate\/2005&#8243;&gt;<\/p>\n<p>&lt;TemplateData&gt;<\/p>\n<p>&lt;Name&gt;Landpy SharePoint Solution Template&lt;\/Name&gt;<\/p>\n<p>&lt;Description&gt;Landpy SharePoint Solution Template&lt;\/Description&gt;<\/p>\n<p>&lt;Icon&gt;Landpy.SolutionTemplate.TemplateContent.ico&lt;\/Icon&gt;<\/p>\n<p>&lt;ProjectType&gt;CSharp&lt;\/ProjectType&gt;<\/p>\n<p>&lt;ProjectSubType&gt;Eisk&lt;\/ProjectSubType&gt;<\/p>\n<p>&lt;\/TemplateData&gt;<\/p>\n<p>&lt;TemplateContent&gt;<\/p>\n<p>&lt;ProjectCollection&gt;<\/p>\n<p>&lt;SolutionFolderName=&#8221;ProductProjects&#8221;&gt;<\/p>\n<p>&lt;ProjectTemplateLinkProjectName=&#8221;SystemInterface&#8221;&gt;<\/p>\n<p>ProjectCollection\\SystemInterfaceLayer\\ProjectTemplate.vstemplate<\/p>\n<p>&lt;\/ProjectTemplateLink&gt;<\/p>\n<p>&lt;ProjectTemplateLinkProjectName=&#8221;Core&#8221;&gt;<\/p>\n<p>ProjectCollection\\Core\\ProjectTemplate.vstemplate<\/p>\n<p>&lt;\/ProjectTemplateLink&gt;<\/p>\n<p>&lt;ProjectTemplateLinkProjectName=&#8221;DomainLayer&#8221;&gt;<\/p>\n<p>ProjectCollection\\DomainLayer\\ProjectTemplate.vstemplate<\/p>\n<p>&lt;\/ProjectTemplateLink&gt;<\/p>\n<p>&lt;ProjectTemplateLinkProjectName=&#8221;TestFramework&#8221;&gt;<\/p>\n<p>ProjectCollection\\TestFramework\\ProjectTemplate.vstemplate<\/p>\n<p>&lt;\/ProjectTemplateLink&gt;<\/p>\n<p>&lt;ProjectTemplateLinkProjectName=&#8221;UnitTest&#8221;&gt;<\/p>\n<p>ProjectCollection\\UnitTest\\ProjectTemplate.vstemplate<\/p>\n<p>&lt;\/ProjectTemplateLink&gt;<\/p>\n<p>&lt;\/SolutionFolder&gt;<\/p>\n<p>&lt;\/ProjectCollection&gt;<\/p>\n<p>&lt;\/TemplateContent&gt;<\/p>\n<p>&lt;\/VSTemplate&gt;<\/p>\n<p>There are several ProjectTemplateLink to link the projects vstemplate file.<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic13-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3320 alignnone\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic13-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"379\" height=\"326\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic13-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 379w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic13-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x258.png 300w\" sizes=\"(max-width: 379px) 100vw, 379px\" \/><\/a><\/p>\n<p>The Core, DomainLayer, PresentationLayer, SystemInterfaceLayer, TestFramework, UnitTest projects are not written by hand. There is a function that can export a single project as a template then you can copy the single template into the Solution Template. The steps are the following:<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic14-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-3321\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic14-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"341\" height=\"309\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic14-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 341w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic14-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x271.png 300w\" sizes=\"(max-width: 341px) 100vw, 341px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic15-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-3322\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic15-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"558\" height=\"440\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic15-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 558w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic15-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x236.png 300w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic16-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-3323\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic16-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"558\" height=\"440\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic16-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 558w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic16-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x236.png 300w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/p>\n<p>In the zip package, you can get the template content.<br \/>\nNote: the cs file Build Action should be &#8220;None&#8221;.<\/p>\n<p>You can get the vstemplate file element info from <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/xwkxbww4.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/msdn.microsoft.com\/en-us\/library\/xwkxbww4.aspx<\/a><\/p>\n<p>Step Two: Create wizard project<\/p>\n<p>It is a Class Library type project, you should reference the System.Windows.Forms, Add a form.<\/p>\n<pre lang=\"csharp\">namespace Landpy.SolutionTemplate.Wizard\r\n{\r\npublicpartialclassWizardForm : Form\r\n    {\r\npublicstring ProjectName { get; privateset; }\r\npublicstring ProjectNamespace { get; privateset; }\r\npublicstring BoxName\r\n        {\r\nset { this.LayerBox.Text = String.Format(@\"{0} Layer\", value); }\r\n        }\r\n\r\npublic WizardForm()\r\n        {\r\n            InitializeComponent();\r\n        }\r\n\r\nprivatevoid OK_Click(object sender, EventArgs e)\r\n        {\r\nthis.ProjectName = this.ProjectNameValue.Text.Trim();\r\nthis.ProjectNamespace = this.ProjectNamespaceValue.Text.Trim();\r\nthis.Close();\r\nthis.Dispose();\r\n        }\r\n    }\r\n}<\/pre>\n<p>And add the Wizard Class which is inherited from IWizard(Microsoft.VisualStudio.TemplateWizardInterface)<\/p>\n<pre lang=\"csharp\">namespace Landpy.SolutionTemplate.Wizard.SolutionTemplateWizard\r\n{\r\nclassUnitTestWizard : IWizard\r\n    {\r\npublicvoid BeforeOpeningFile(ProjectItem projectItem)\r\n        {\r\n        }\r\n\r\npublicvoid ProjectFinishedGenerating(Project project)\r\n        {\r\n        }\r\n\r\npublicvoid ProjectItemFinishedGenerating(ProjectItem projectItem)\r\n        {\r\n        }\r\n\r\npublicvoid RunFinished()\r\n        {\r\n        }\r\n\r\npublicvoid RunStarted(object automationObject, Dictionary replacementsDictionary, WizardRunKind runKind, object[] customParams)\r\n        {\r\ntry\r\n            {\r\n                replacementsDictionary.Add(\"$DomainLayerProjectName$\",\r\nCommonReplacementsDictionary.ReplacementsDictionary[\"$DomainLayerProjectName$\"]);\r\n                replacementsDictionary.Add(\"$DomainLayerProjectNamespace$\",\r\nCommonReplacementsDictionary.ReplacementsDictionary[\"$DomainLayerProjectNamespace$\"]);\r\n                replacementsDictionary.Add(\"$SystemInterfaceProjectName$\",\r\nCommonReplacementsDictionary.ReplacementsDictionary[\"$SystemInterfaceProjectName$\"]);\r\n                replacementsDictionary.Add(\"$SystemInterfaceProjectNamespace$\",\r\nCommonReplacementsDictionary.ReplacementsDictionary[\"$SystemInterfaceProjectNamespace$\"]);\r\n            }\r\ncatch (Exception exception)\r\n            {\r\nMessageBox.Show(exception.Message);\r\n            }\r\n        }\r\n\r\npublicbool ShouldAddProjectItem(string filePath)\r\n        {\r\nreturntrue;\r\n        }\r\n    }\r\n}<\/pre>\n<p>You should configure the vstemplate file as follows:<\/p>\n<div>&lt;VSTemplateVersion=&#8221;3.0.0&#8243;xmlns=&#8221;http:\/\/schemas.microsoft.com\/developer\/vstemplate\/2005&#8243;Type=&#8221;Project&#8221;&gt;<br \/>\n&lt;TemplateData&gt;<br \/>\n&lt;Name&gt;BoostSolutions.DomainLayer&lt;\/Name&gt;<br \/>\n&lt;Description&gt;&lt;;No description available&gt;;&lt;\/Description&gt;<br \/>\n&lt;ProjectType&gt;CSharp&lt;\/ProjectType&gt;<br \/>\n&lt;ProjectSubType&gt;<br \/>\n&lt;\/ProjectSubType&gt;<br \/>\n&lt;SortOrder&gt;1000&lt;\/SortOrder&gt;<br \/>\n&lt;CreateNewFolder&gt;true&lt;\/CreateNewFolder&gt;<br \/>\n&lt;DefaultName&gt;BoostSolutions.DomainLayer&lt;\/DefaultName&gt;<br \/>\n&lt;ProvideDefaultName&gt;true&lt;\/ProvideDefaultName&gt;<br \/>\n&lt;LocationField&gt;Enabled&lt;\/LocationField&gt;<br \/>\n&lt;EnableLocationBrowseButton&gt;true&lt;\/EnableLocationBrowseButton&gt;<br \/>\n&lt;Icon&gt;&lt;\/Icon&gt;<br \/>\n&lt;\/TemplateData&gt;<br \/>\n&lt;TemplateContent&gt;<br \/>\n&lt;ProjectTargetFileName=&#8221;BoostSolutions.DomainLayer.csproj&#8221;File=&#8221;BoostSolutions.DomainLayer.csproj&#8221;ReplaceParameters=&#8221;true&#8221;&gt;<br \/>\n&lt;FolderName=&#8221;DemoModule&#8221;TargetFolderName=&#8221;DemoModule&#8221;&gt;<br \/>\n&lt;ProjectItemReplaceParameters=&#8221;true&#8221;TargetFileName=&#8221;Demo.cs&#8221;&gt;Demo.cs&lt;\/ProjectItem&gt;<br \/>\n&lt;\/Folder&gt;<br \/>\n&lt;FolderName=&#8221;Properties&#8221;TargetFolderName=&#8221;Properties&#8221;&gt;<br \/>\n&lt;ProjectItemReplaceParameters=&#8221;true&#8221;TargetFileName=&#8221;AssemblyInfo.cs&#8221;&gt;AssemblyInfo.cs&lt;\/ProjectItem&gt;<br \/>\n&lt;\/Folder&gt;<br \/>\n&lt;ProjectItemReplaceParameters=&#8221;false&#8221;TargetFileName=&#8221;BoostSolutions.snk&#8221;&gt;BoostSolutions.snk&lt;\/ProjectItem&gt;<br \/>\n&lt;\/Project&gt;<br \/>\n&lt;\/TemplateContent&gt;<br \/>\n&lt;WizardExtension&gt;<br \/>\n&lt;Assembly&gt;Landpy.SolutionTemplate.Wizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2a7779dfd1034e2f&lt;\/Assembly&gt;<br \/>\n&lt;FullClassName&gt;Landpy.SolutionTemplate.Wizard.SolutionTemplateWizard.DomainLayerWizard&lt;\/FullClassName&gt;<br \/>\n&lt;\/WizardExtension&gt;<br \/>\n&lt;\/VSTemplate&gt;<\/div>\n<p>&nbsp;<\/p>\n<p>WizardExtension element will reference the wizard assembly.<\/p>\n<pre lang=\"csharp\">namespace Landpy.SolutionTemplate.Wizard.SolutionTemplateWizard\r\n{\r\nclassDomainLayerWizard : IWizard\r\n    {\r\nprivateWizardForm wizardForm;\r\n\r\npublicvoid BeforeOpeningFile(ProjectItem projectItem)\r\n        {\r\n        }\r\n\r\npublicvoid ProjectFinishedGenerating(Project project)\r\n        {\r\n        }\r\n\r\npublicvoid ProjectItemFinishedGenerating(ProjectItem projectItem)\r\n        {\r\n        }\r\n\r\npublicvoid RunFinished()\r\n        {\r\n        }\r\n\r\npublicvoid RunStarted(object automationObject, Dictionary replacementsDictionary, WizardRunKind runKind, object[] customParams)\r\n        {\r\ntry\r\n            {\r\nthis.wizardForm = newWizardForm();\r\nthis.wizardForm.BoxName = \"Domain\";\r\nthis.wizardForm.ShowDialog();\r\n                replacementsDictionary.Add(\"$DomainLayerProjectName$\",\r\nthis.wizardForm.ProjectName);\r\n                replacementsDictionary.Add(\"$DomainLayerProjectNamespace$\",\r\nthis.wizardForm.ProjectNamespace);\r\nCommonReplacementsDictionary.ReplacementsDictionary.Add(\"$DomainLayerProjectName$\",\r\nthis.wizardForm.ProjectName);\r\nCommonReplacementsDictionary.ReplacementsDictionary.Add(\"$DomainLayerProjectNamespace$\",\r\nthis.wizardForm.ProjectNamespace);\r\n                replacementsDictionary.Add(\"$SystemInterfaceProjectName$\",\r\nCommonReplacementsDictionary.ReplacementsDictionary[\"$SystemInterfaceProjectName$\"]);\r\n                replacementsDictionary.Add(\"$SystemInterfaceProjectNamespace$\",\r\nCommonReplacementsDictionary.ReplacementsDictionary[\"$SystemInterfaceProjectNamespace$\"]);\r\n            }\r\ncatch (Exception exception)\r\n            {\r\nMessageBox.Show(exception.Message);\r\n            }\r\n        }\r\n\r\npublicbool ShouldAddProjectItem(string filePath)\r\n        {\r\nreturntrue;\r\n        }\r\n    }\r\n}<\/pre>\n<p>The <span style=\"color: #ff0000\">&#8220;$DomainLayerProjectName$&#8221;<\/span> can be input in wizard form, and will be replaced in the generated file:<\/p>\n<pre lang=\"csharp\">namespace $DomainLayerProjectName$.DemoModule\r\n{\r\npublicclassDemo : IDemo\r\n    {\r\n        [NotThrowException]\r\n        [LogException]\r\npublicint TestMethod()\r\n        {\r\nreturn 1314;\r\n        }\r\n\r\n        [NotThrowException]\r\n        [LogException]\r\npublicint TestMethodWithException()\r\n        {\r\nthrownew System.NotImplementedException();\r\n        }\r\n    }\r\n}<\/pre>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic17-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-3324\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic17-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"558\" height=\"341\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic17-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 558w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic17-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x183.png 300w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/p>\n<p>Step Four: Create a VSIX Project<\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic18-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-3325\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic18-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"557\" height=\"194\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic18-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 557w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic18-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x104.png 300w\" sizes=\"(max-width: 557px) 100vw, 557px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic19-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-3326\" src=\"http:\/\/www.BoostSolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic19-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png\" alt=\"\" width=\"557\" height=\"87\" srcset=\"https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic19-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template.png 557w, https:\/\/www.boostsolutions.com\/blog\/wp-content\/uploads\/2011\/12\/Pic19-How-To-Create-Your-SharePoint-VisualStudio-Multiple-Project-Template-300x46.png 300w\" sizes=\"(max-width: 557px) 100vw, 557px\" \/><\/a><\/p>\n<p>Add the Wizard and Template Content project into the VSIX Project.<\/p>\n<p>Note: the Product name and author should not be too long, or when we install the extensibility a System.IO.PathTooLongException exception will occur.<\/p>\n<p>Build the VSIX project, and now you have your own Solution Template.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you wasting your time to create a SharePoint foundation solution architecture? Let&#8217;s assume you are a software architect, and you have to create the template for a new product. It is a repetitive task and will cost you a lot of time for the following: You shall define the layers for your solution, such [&hellip;]<\/p>\n","protected":false},"author":26,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[125],"tags":[298],"_links":{"self":[{"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3305"}],"collection":[{"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=3305"}],"version-history":[{"count":6,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3305\/revisions"}],"predecessor-version":[{"id":9258,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3305\/revisions\/9258"}],"wp:attachment":[{"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boostsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}