asp.net - Multi Project Template folder structure incorrect -


so trying build multi project template , when set folder structure coming out incorrectly (not how microsoft when creating projects) , it's messing things packages folder , references folder.

this current structure:

solution folder -solution file -folder (solution name)  --packages  --references  --project1 folder  --project2 folder 

i wanting have same structure .net automatically:

solution folder -solution file -references folder -packages folder -project1 folder -project2 folder 

here vstemplate:

<vstemplate version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" type="projectgroup">   <templatedata>     <name>asp solution template</name>     <description>this solution template asp applications</description>     <icon>__templateicon.ico</icon>     <projecttype>csharp</projecttype>   </templatedata>   <templatecontent buildonload="true">     <projectcollection>       <solutionfolder name="references">       </solutionfolder>       <solutionfolder name="packages">       </solutionfolder>       <projecttemplatelink projectname="$safeprojectname$">         asptemplate\mytemplate.vstemplate       </projecttemplatelink>       <projecttemplatelink projectname="$safeprojectname$.classlibrary">         classlibrary\mytemplate.vstemplate       </projecttemplatelink>     </projectcollection>   </templatecontent> </vstemplate> 

i don't think it's possible add solution folders in parent solution folder vstemplates.

however, try adding wizard template enables run custom code when user creates project template.

follow instructions here , here, this:

  1. implement iwizard interface in classlibrary-project , use envdte80 create folders:

    public class mywizard : iwizard {     public void runstarted(object automationobject, dictionary<string, string> replacementsdictionary, wizardrunkind runkind, object[] customparams)     {         // pseudo-code         var dte = (dte2)automationobject;         var solution = (solution2)dte.solution;          solution.addsolutionfolder("references");     }      // default implementations of iwizard here (return true's , nothing's) } 
  2. modify vstemplate use wizard:

    <vstemplate version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" type="projectgroup">   <templatedata />   <templatecontent buildonload="true" /> <!-- remove solutionfolder elements -->    <wizardextension>     <assembly>customwizard, version=1.0.0.0, culture=neutral, publickeytoken=fa3902f409bb6a3b</assembly>     <fullclassname>customwizard.mywizard</fullclassname>   </wizardextension>  </vstemplate> 

then code should running when create project new template.

hope helps somehow.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -