How to add a link to the Same Solution Project when exporting templates in Visual Studio?

I have a solution that contains several projects, allows you to call them ProjectA and ProjectB. I need ProjectA to have a link to ProjectB, but when I "Export Template", I can not save the link. What I'm trying to do is create a link for me when I create a new project and then automatically name it what I entered.

+5
source share
1 answer

This is a bit beyond the scope of pure Visual Studio templates.

Visual Studio templates support replacement options for templates, so you can do the following:

  • ProjectA.zip ProjectA.csproj,
  • ProjectA.csproj <ItemGroup> <Reference>
  • <Reference Include="ProjectB">

ProjectB- , ProjectB , $Foo$.

: $Foo$? ?

- , ProjectB, .

, :

  • VSIX.
  • [ProvideBindingPath] . ( GAC, VS )
  • , Microsoft.VisualStudio.TemplateWizard.IWizard
  • ProjectTemplate vsixmanifest

.vstemplate <TemplateContent>:

<WizardExtension>
  <Assembly>Your.Packages.Assembly</Assembly>
  <FullClassName>Your.Wizard</FullClassName>
</WizardExtension>

. RunStarted , , automationObject ( EnvDTE.DTE), ProjectB replacementsDictionary.

+1

All Articles