79173295

Date: 2024-11-09 17:20:05
Score: 2.5
Natty:
Report link

I have the same problem with desktop application (target framework is net8.0).
The Debug configuration runs without any problem. But Release configuration suddenly gives the following error:
Error message

My application uses Microsoft.NETCore.App framework version 8.0.10:
App framework

Output of 'dotnet --list-runtimes' command is:

Microsoft.AspNetCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

My project is located in regular folder, not OneDrive.

Here is the content of MyApp.runtimeconfig.json file located in the output Release folder near MyApp.exe:

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "8.0.0"
    },
    "configProperties": {
      "System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
      "System.Runtime.InteropServices.BuiltInComInterop.IsSupported": true,
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false,
      "System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault": false
    }
  }
}
Reasons:
  • Blacklisted phrase (1): I have the same problem
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): I have the same problem
  • Low reputation (0.5):
Posted by: Sergey