-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Milestone
Description
Description
Fail with simple GTK4 Test app compiled with AOT in NET10.
In NET9 or via dotnet run with NET10 work fine.
Error creando Gtk.Application: System.InvalidOperationException: Failed to set the specified COM apartment state. Current apartment state 'MTA'.
at System.Threading.Thread.SetApartmentStateUnchecked(ApartmentState, Boolean) + 0x15f
at myProgram.Program.
Reproduction Steps
Project.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>gtk4Test</AssemblyName>
<PublishAot>true</PublishAot>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="GirCore.Gtk-4.0" Version="0.7.0-preview.2" />
<PackageReference Include="GirCore.Gio-2.0" Version="0.7.0-preview.2" />
<PackageReference Include="GirCore.GtkSource-5" Version="0.7.0-preview.2" />
<PackageReference Include="GirCore.GObject-2.0.Integration" Version="0.7.0-preview.2" />
</ItemGroup>
</Project>
Program.cs
[System.STAThread]
public static void Main(string[] args)
{
var application = Gtk.Application.New("org.GirCore.GTK4TestApp", Gio.ApplicationFlags.FlagsNone);
}
Expected behavior
In NET9 work fine.
Actual behavior
Error creando Gtk.Application: System.InvalidOperationException: Failed to set the specified COM apartment state. Current apartment state 'MTA'.
at System.Threading.Thread.SetApartmentStateUnchecked(ApartmentState, Boolean) + 0x15f
at myProgram.Program.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Type
Projects
Status
No status