dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.65k stars 1.05k forks source link

Prevent --output command-line option for multi-targeted projects #13369

Open dsplaisted opened 4 years ago

dsplaisted commented 4 years ago

For a multi-targeted build, the --output command-line option will cause the builds for multiple target frameworks to go to the same output path. This will likely cause a build failure due to files being in use, or an incorrect build output. See #13359.

We should do something to avoid this pit of failure. Some possibilities:

dsplaisted commented 4 years ago

Also related (to some degree): https://github.com/dotnet/msbuild/issues/5420

dsplaisted commented 3 years ago

Related / Dupe: #8964

Forgind commented 3 years ago

@dsplaisted, I closed the MSBuild issue for this with https://github.com/dotnet/msbuild/pull/5675. Are you planning to make the PR for consuming this in the SDK, do you want me to, or was it already done, and I forgot?

Nirmal4G commented 2 years ago

See https://github.com/dotnet/sdk/issues/8964#issuecomment-656767258

My preferred solution would be that we map BaseOutputPath to -o instead of OutputPath for both legacy and Sdk-style projects. With BaseOutputPath (dotnet/msbuild#5238) support added to Common targets, we could just do that.