Reputation: 104692
I have a multi-project solution template. I've created it using this guide.
My solution is generating multi-platform projects with a central shared project:
MyProject.Shared
MyProject.UWP
MyProject.Droid
The problem is that when I use $safeprojectname$.Shared
in the csproj file of the individual projects (let's say in the UWP one) in order to add a reference to the shared project, what gets generated is MyProject1.UWP.Shared
instead of MyProject1.Shared
.
How do I refer to the shared project name / solution name from the individual projects?
P.S. There is the $SpecificSolutionName$
parameter, but that only works if the user checked the Create solution directory option, not good enough for me.
TL;DR
How do I get partial project name from parameter?
Upvotes: 5
Views: 1264
Reputation: 5202
In the root .vstemplate file you should use ProjectName="$projectname$"
in ProjectTemplateLink
tag:
<TemplateContent>
<ProjectCollection>
<ProjectTemplateLink ProjectName="$projectname$.Shared" CopyParameters="true">
MyProject.Shared\MyTemplate.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="$projectname$.UWP" CopyParameters="true">
MyProject.UWP\MyTemplate.vstemplate
</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="$projectname$.Droid" CopyParameters="true">
MyProject.Droid\MyTemplate.vstemplate
</ProjectTemplateLink>
</ProjectCollection>
</TemplateContent>
Upvotes: 1