C# .NET 6.0 WinForms x64bit Desktop application
Application exe runs fine via the project's "x64\Release" folder.
We deliver via an MSI created via "Setup and Deployment Tool". When the application is installed via the MSI file, the user gets an exception as the application launches.
System.PlatformNotSupportedException: System.Management currently is only supported for Windows desktop applications. at System.Management.ManagementBaseObject..ctor(SerializationInfo inf, StreamingContext context)
I've tracked this down to a difference in the file: MyApp.deps.json between the "Release" folder and the installed destination "Program Files" folder.
If I copy that "Release" .json file to the "Program Files..." location, the application runs fine.
What's going on with the Setup and Deployment MSI creator? How can I fix this?