Skip to content
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

Prevent OutputPath from flowing to project references via a global property #5420

Closed
dsplaisted opened this issue Jun 10, 2020 · 2 comments · Fixed by #5675
Closed

Prevent OutputPath from flowing to project references via a global property #5420

dsplaisted opened this issue Jun 10, 2020 · 2 comments · Fixed by #5675
Labels
Milestone

Comments

@dsplaisted
Copy link
Member

The .NET CLI supports --output as a parameter to the build command, and translates this into a -property:OutputPath parameter to MSBuild.

Since this is a global property, it will flow to referenced projects and they will all build with the same output path. This isn't safe. We should add OutputPath to a list of properties which we remove when building project references.

@rainersigwald
Copy link
Member

Today, we don't have any default value for

https://github.com/microsoft/msbuild/blob/9eb5d09e6cd262375e37a15a779d56ab274167c8/src/Tasks/Microsoft.Common.CurrentVersion.targets#L1814

This would involve adding one or hardcoding it at the callsites; that could create problems.

Logically, I agree with you, but some people might depend on it (with UseCommonOutputDirectory=true?). I think we'd at least need an opt-out; maybe we should do an opt-in and opt in at the SDK layer?

@rainersigwald rainersigwald added this to the MSBuild 16.8 milestone Jun 24, 2020
@dsplaisted
Copy link
Member Author

We might want to consider also stopping other OutputPath-like properties from flowing, such as BaseIntermediateOutputPath.

Forgind added a commit to Forgind/msbuild that referenced this issue Aug 24, 2020
Forgind added a commit to Forgind/msbuild that referenced this issue Oct 28, 2020
Forgind added a commit that referenced this issue Nov 13, 2020
Prevent outputpath from flowing to projectreferences

SDK-side change still required

Fixes #5420
@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants