-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft.Build.Traversal does not respect SetPlatform or AdditionalProperties on ProjectReference items #207
Comments
If this seems reasonable, I can just PR it in. |
Sounds like a good change, there's another property But I think https://github.com/dotnet/msbuild/blob/master/src/Tasks/MSBuild.cs#L543-L553 |
You're right, it looks like |
Yes just those 3 properties to mirror the logic used in ResolveProjectReferences. Please send a PR! |
@forrestcoward @jeffkl how do I pass variables like Configuration downstream? I tried setting Configuration to Release like this:
but it doesn't get applied to the ProjectReference:
|
@tmds you'll need to add the metadata to the ProjectReference to opt into this behavior: <ItemGroup>
<ProjectReference Include="console/console.csproj" SetConfiguration="Configuration=$(Configuration)"/>
</ItemGroup> Or you can set it as a global property:
|
The Microsoft.Build.Traversal SDK does not respect
SetPlatform
,SetConfiguration
orAdditionalProperties
onProjectReference
items, it ignores them, effectively losing the metadata. It is customary for global properties to propagate alongProjectReference
.Here is the location I am looking at that is offending:
https://github.com/microsoft/MSBuildSdks/blob/master/src/Traversal/Sdk/Sdk.targets#L123-L136
The solution is something like this:
Note the addition of
Properties
attribute.Why is this needed? Anybody setting properties on their
ProjectReference
lose them when using the traversal SDK. In my case, these properties are valuable.The text was updated successfully, but these errors were encountered: