-
Notifications
You must be signed in to change notification settings - Fork 59
System.CodeDom.dll is copied to the output/build directory when referencing System.Management v8 #4152
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
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
When the project targets net7.0-windows and references System.Management 7.0.2, .NET SDK does not copy System.CodeDom.dll to the output directory;
When the project targets net8.0-windows and references System.Management 7.0.2, .NET SDK does not copy System.CodeDom.dll to the output directory;
When the project targets net7.0-windows and references System.Management 8.0.0, .NET SDK copies System.CodeDom.dll to the output directory:
When the project targets net8.0-windows and references System.Management 8.0.0, .NET SDK copies System.CodeDom.dll to the output directory:
It seems that, when .NET SDK chooses 'Platform:System.CodeDom.dll', it does not copy that to the output directory; but the reason for choosing that is not always the same. "C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\8.0.1\data\PlatformManifest.txt" lists:
Each line is formatted as fileName |
cc @ericstj in case he knows why |
The PlatformManifests doesn't assume a serviced runtime - they are supposed to contain the versions of platform at GA. The SDK then decides what to ship based on what's newer than GA. When you build an app that targets In .NET 7 - the platform manifest had the exact match of the build versions that were shipped in 7.0 packages (which is expected). So the SDK chose to drop the packages in favor of the copy from the runtime. In 8.0 I observe the following From
From
The 8.0.0 targeting pack was correct, the 8.0.1 targeting pack is incorrect. Looks like the versions went backwards. This will cause any 8.0 package that overlaps with WindowsDesktop to ship with the app even if it's the same version. This is somewhat harmless as it's normal for packages to ship in the app once serviced (since the SDK cannot assume a serviced shared framework) but it is undesirable for application size. |
@lonitra @ViktorHofer please have a look. It seems the platformmanifest for WindowsDesktop has the wrong file versions in servicing. I think https://github.com/dotnet/windowsdesktop/blob/release/8.0/src/windowsdesktop/src/sfx/PlatformManifest.txt needs to be updated with the exact content that shipped at GA. |
Sorry but I don't have any context on this. @lonitra PTAL |
Fix will be available in .NET 8 March servicing release. |
@lonitra Awesome, thanks a lot for the quick fix! |
Describe the bug
There appears to be an issue in .NET 8's System.Management package that unnecessarily copies
System.CodeDom.dll
to the output/build directory. This does not occur in .NET 7 / System.Management v7.To Reproduce
System.CodeDom.dll
exists:\bin\Debug\net8.0-windows\System.CodeDom.dll
Now, if you go into your NuGet packages and downgrade System.Management from v8.0.0 to v7.0.2, rebuild the project, you will find that
System.CodeDom.dll
is no longer copied. The issue seems exclusive to the .NET 8 version of System.Management.Further technical details
Visual Studio 2022 64-bit, version 17.8.6
dotnet --info
The text was updated successfully, but these errors were encountered: