Skip to content

NativeAot project throws when running the published executable #4231

@BDisp

Description

@BDisp

To repro this issue:

  • Right click the NativeAot project and click in Publish...
  • Select the FolderProfile_net8.0_win-x64_Release.pubxml profile
  • Click in the Publish button
  • When ready click on the Navigate link
  • Right click in the explorer and select Open in the Terminal
  • Write .\NativeAot.exe to run the app
  • The follow exception will throw
╰─ .\NativeAot.exe
Unhandled Exception: System.ArgumentException: Object of type 'System.Collections.Generic.Dictionary`2[System.String,Terminal.Gui.Configuration.ThemeScope]' cannot be converted to type 'System.Collections.Concurrent.ConcurrentDictionary`2[System.String,Terminal.Gui.Configuration.ThemeScope]'.
   at System.Reflection.DynamicInvokeInfo.CheckArguments(Span`1, Void*, Object[], BinderBundle) + 0x2d1
   at System.Reflection.DynamicInvokeInfo.InvokeWithFewArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x7e
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0x11d
   at Internal.Reflection.Execution.MethodInvokers.StaticMethodInvoker.Invoke(Object, Object[], BinderBundle, Boolean) + 0x29
   at Internal.Reflection.Core.Execution.MethodBaseInvoker.Invoke(Object, Object[], Binder, BindingFlags, CultureInfo) + 0x45
   at System.Reflection.Runtime.PropertyInfos.RuntimePropertyInfo.SetValue(Object, Object, BindingFlags, Binder, Object[], CultureInfo) + 0x10a
   at System.Reflection.PropertyInfo.SetValue(Object, Object, Object[]) + 0x21
   at Terminal.Gui.Configuration.Scope`1.Apply() + 0x17e
   at Terminal.Gui.Configuration.ConfigurationManager.InternalApply() + 0x34
   at Terminal.Gui.Configuration.ConfigurationManager.Enable(ConfigLocations locations) + 0x8e
   at NativeAot.Program.Main(String[] args) + 0x10
   at NativeAot!<BaseAddress>+0x7dd913

For Linux execute the Publish_linux-x64_Release.sh file.
For Mac execute the Publish_osx-x64_Release.sh file.

Metadata

Metadata

Assignees

Type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions