Open hvanbakel opened 6 years ago
@nguerrera can you comment on this? I believe that when you specify the output we honor it no matter what, even if in this case, the dlls will stomp on each other.
Should we do the appendtfm in this case? Or we explicitly decided not to?
@rohit21agrawal can you comment on this? This works for dotnet pack
. Seems to fail only for dotnet build
with the GeneratePackageOnBuild
set to true.
Is this something that the SDK is missing to set?
Seems like -o is just broken for multi-targeting. It sets outputpath as a global property and that nullifies our appending of TFM. I think we need to change what -o passes to something like /p:OutputPathOverride=value and then we can build the real OutputPath from override + TFM.
I don't see it working for dotnet build
.
Good point. Ok, I am moving this back to 2.1.300. This is pretty bad.
This is tricky to fix. We need to use OutputPathOverride when directly when single-targeted for maximum compat.
Alternatively, one if the imported targets could set TreatAsLocalProperty="OutputPath"
but that would be a dirty fix I guess..
This bit me, too, and cost me an afternoon! Thanks for filing the issue and workaround @hvanbakel. Confirmed that not setting output folder worked around the issue for me.
I got hit by this today. I tried to see if I could include the TargetFramework into the output path but it didn't work.
Something like dotnet build /p:OutDir=bin\shared\$(TargetFrameWork)"
Seems like -o is just broken for multi-targeting. It sets outputpath as a global property and that nullifies our appending of TFM. I think we need to change what -o passes to something like /p:OutputPathOverride=value and then we can build the real OutputPath from override + TFM.
@nguerrera 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.
Steps to reproduce
Create new net standard library. Set project file to be:
open command line and run
Extract the nupkg generated in the out folder In the extracted folder, open the lib\net46 folder and decompile the assembly that is in there.
Expected behavior
This assembly should have
Actual behavior
instead it has:
The origin is most likely that the build step creates the 46 version first, then OVERWRITES the dll with the netstandard20 version and then packs that into both folders.
Environment data
To be fair, this issue doesn't occur when there is no output folder specified.