Closed kant2002 closed 2 years ago
I tried your sample in 17.2.0 Preview 3.0, and it appears to "works on my machine"....
The error message suggests you have build-in COM disabled via a feature switch, though I couldn't readily find the switch via the provided link. @agocke @lakshanf would you know what the feature switch is, or where it is doc'ed? Thanks
BuiltInComInteropSupport
is the MSBuild switch, or <RuntimeHostConfigurationOption Include="System.Runtime.InteropServices.BuiltInComInterop.IsSupported" Value="false" />
runtime host configuration.
I play a bit with code, and Yes. I cheat a bit. Add following lines
<PublishTrimmed>true</PublishTrimmed>
<_SuppressWinFormsTrimError>true</_SuppressWinFormsTrimError>
Remove bin
and obj
and rebuild project. You should see issue with blank Winforms project too.
PublishTrimmed
implicitly trigger BuiltInComInteropSupport
if I remember correctly.
After my CCW changes lands, issue disappear in latest preview.
Environment
Version 17.2.0 Preview 2.1
.NET version
7.0 Preview 4
Did this work in a previous version of Visual Studio and/or previous .NET release?
Actually have no idea, I know that designer is flacky.
Issue description
Designer seems to be running with disabled COM interop and some love from Winforms needed.
On the opening form with project WinFormsApp6953.zip
following screen for designer displayed
Steps to reproduce
<TargetFramework>net7.0-windows</TargetFramework>
Diagnostics
No response