Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 3d6a673

Browse files
author
Rodrigo Moya
committed
[Ide] Work around bug in Xamarin.Forms multi project templates
The templating engine creates all the outputs correctly, but PrimaryOutputs contains the files containing the "sourceName" from the template ("NewApp" in the Xamarin.Forms case), not the real names of the files on disk (NewApp.csproj instead of $ProjectName.csproj). Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1016597
1 parent fa939f1 commit 3d6a673

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/MicrosoftTemplateEngineProjectTemplatingProvider.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ public async Task<ProcessedTemplateResult> ProcessTemplate (SolutionTemplate tem
105105
//TODO: Once templates support "D396686C-DE0E-4DE6-906D-291CD29FC5DE" use that to load projects
106106
foreach (var path in result.ResultInfo.PrimaryOutputs) {
107107
var fullPath = Path.Combine (config.ProjectLocation, GetPath (path));
108+
if (!File.Exists (fullPath)) {
109+
// Work around a bug in the templating engine with multi project templates
110+
// See https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1016597
111+
fullPath = fullPath.Replace ("NewApp", config.ProjectName);
112+
}
113+
108114
if (Services.ProjectService.IsSolutionItemFile (fullPath))
109115
workspaceItems.Add (await MonoDevelop.Projects.Services.ProjectService.ReadSolutionItem (new Core.ProgressMonitor (), fullPath));
110116
}

0 commit comments

Comments
 (0)