Browse Source

Handle project evaluation target path with spaces (#891)

johluo/lock
John Luo 6 years ago
committed by GitHub
parent
commit
659baa7d73
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/Microsoft.Tye.Core/ApplicationFactory.cs

5
src/Microsoft.Tye.Core/ApplicationFactory.cs

@ -516,16 +516,17 @@ namespace Microsoft.Tye
output.WriteDebugLine("Restoring and evaluating projects");
var projectEvaluationTargets = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "ProjectEvaluation.targets");
var msbuildEvaluationResult = await ProcessUtil.RunAsync(
"dotnet",
$"build " +
$"\"{projectPath}\" " +
// CustomAfterMicrosoftCommonTargets is imported by non-crosstargeting (single TFM) projects
$"/p:CustomAfterMicrosoftCommonTargets={Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "ProjectEvaluation.targets")} " +
@$"/p:CustomAfterMicrosoftCommonTargets=""{projectEvaluationTargets}"" " +
// CustomAfterMicrosoftCommonCrossTargetingTargets is imported by crosstargeting (multi-TFM) projects
// This ensures projects properties are evaluated correctly. However, multi-TFM projects must specify
// a specific TFM to build/run/publish and will otherwise throw an exception.
$"/p:CustomAfterMicrosoftCommonCrossTargetingTargets={Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "ProjectEvaluation.targets")} " +
@$"/p:CustomAfterMicrosoftCommonCrossTargetingTargets=""{projectEvaluationTargets}"" " +
$"/nologo",
throwOnError: false,
workingDirectory: directory.DirectoryPath);

Loading…
Cancel
Save