Double write during publish
See original GitHub issuePublishing a self-contained WPF template app writes some files twice because ResolvedFileToPublish
has the same dll from different runtime packs (for example, Microsoft.Win32.Registry.dll comes from both netcoreapp and the windowsdesktop pack).
This causes crossgen failures when used together with PublishReadyToRun=true
.
Looks very similar to https://github.com/dotnet/sdk/issues/3035 which was addressed in https://github.com/dotnet/sdk/pull/3021, but I’m still seeing this with version 3.0.100-preview6-012031
.
/cc @fadimounir @nguerrera @peterhuene
edit: it fails during PublishReadyToRun=true
only when used together with the linker. Without linking, the duplicates are already crossgen’d, and so they don’t hit the failure. In any case, ResolvedFileToPublish
has duplicates that shouldn’t be there, and we end up with DoubleWrites
of some files.
![image](https://user-images.githubusercontent.com/787361/58192612-00a04780-7c76-11e9-8ffc-102d4b993fb2.png)
Issue Analytics
- State:
- Created 4 years ago
- Comments:22 (22 by maintainers)
I have a fix locally for the satellite duplicates. It comes down to an msbuild batching behavior that I don’t actually understand yet. 😊 I will add some test coverage and also file a discussion issue on the msbuild repo so I can solidify my understanding and help future me and others with similar issues.
I probably don’t know the full range of things to be nervous about with this–the concrete thing I can think of is the files disappearing from NETCoreApp’s runtime, breaking WindowsDesktop runtime. I’m pretty sure
VerifyClosure
wouldn’t catch that since it only looks at NETCoreApp’sReference
s, but maybe it could be enhanced? Then we could make some change (not necessarily inVerifyClosure
) to catch duplicate assemblies with the same versions to change to ref-only. Filed https://github.com/dotnet/core-setup/issues/6727.But that just solves duplicates between NETCoreApp and WindowsDesktop, not sibling frameworks like WindowsDesktop and AspNetCore, so making
publish
nicely handle duplicates still seems necessary. Removing duplicates would just be to reduce FDD and dev-time disk usage.