diff options
Diffstat (limited to 'src/wix/WixToolset.BuildTasks/UpdateProjectReferenceMetadata.cs')
| -rw-r--r-- | src/wix/WixToolset.BuildTasks/UpdateProjectReferenceMetadata.cs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/wix/WixToolset.BuildTasks/UpdateProjectReferenceMetadata.cs b/src/wix/WixToolset.BuildTasks/UpdateProjectReferenceMetadata.cs index d391bdb9..238ab02d 100644 --- a/src/wix/WixToolset.BuildTasks/UpdateProjectReferenceMetadata.cs +++ b/src/wix/WixToolset.BuildTasks/UpdateProjectReferenceMetadata.cs | |||
| @@ -364,7 +364,26 @@ namespace WixToolset.BuildTasks | |||
| 364 | } | 364 | } |
| 365 | } | 365 | } |
| 366 | 366 | ||
| 367 | return new ProjectReferenceFacade(projectReference, configurations, null, platforms, null, targetFrameworks, null, runtimeIdentifiersValue.Values, null, publishBaseDir); | 367 | // If the Properties metadata is specified MSBuild will not use TargetFramework inference and require explicit declaration of |
| 368 | // our expansions (Configurations, Platforms, TargetFrameworks, RuntimeIdentifiers). Rather that try to interoperate, we'll | ||
| 369 | // warn the user that we're disabling our expansion behavior. | ||
| 370 | var propertiesValue = projectReference.GetMetadata("Properties"); | ||
| 371 | |||
| 372 | if (!String.IsNullOrWhiteSpace(propertiesValue) && (configurationsValue.HadValue || platformsValue.HadValue || targetFrameworksValue.HadValue || runtimeIdentifiersValue.HadValue)) | ||
| 373 | { | ||
| 374 | logger.LogWarning( | ||
| 375 | "ProjectReference '{0}' specifies 'Properties' metadata. " + | ||
| 376 | "That overrides ProjectReference expansion so the 'Configurations', 'Platforms', 'TargetFrameworks', and 'RuntimeIdentifiers' metadata was ignored. " + | ||
| 377 | "Instead, use the 'AdditionalProperties' metadata to pass properties to the referenced project without disabling ProjectReference expansion.", | ||
| 378 | projectReference.ItemSpec); | ||
| 379 | |||
| 380 | // Return a facade that does not participate in expansion. | ||
| 381 | return new ProjectReferenceFacade(projectReference, Array.Empty<string>(), null, Array.Empty<string>(), null, Array.Empty<string>(), null, Array.Empty<string>(), null, publishBaseDir); | ||
| 382 | } | ||
| 383 | else | ||
| 384 | { | ||
| 385 | return new ProjectReferenceFacade(projectReference, configurations, null, platforms, null, targetFrameworks, null, runtimeIdentifiersValue.Values, null, publishBaseDir); | ||
| 386 | } | ||
| 368 | } | 387 | } |
| 369 | 388 | ||
| 370 | public string CalculatePublishDir() | 389 | public string CalculatePublishDir() |
