I have a Windows Service application that targets .NET 6 (Windows).
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>x64</Platforms>
</PropertyGroup>
For some reason, one of our customers (Windows 11) encountered an error when trying to run this service.
Screenshot of an error in Event Viewer
My question is: Why is the system complaining about a specific version of the .NET runtime, particularly focusing on the minor version?
Here’s how my *.runtimeconfig.json
looks:
{
"runtimeOptions": {
"tfm": "net6.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "6.0.0"
}
],
"configProperties": {
"System.GC.Server": true,
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}
I’ve tried to reproduce this case on Windows 10, and the Windows Service was installed successfully with only version 6.0.32 of the .NET runtime installed.