In windows 8.1 Environment.OSVersion underlying Win32 GetVersionEx function changed to for compatibility reasons report latest version app is compiled for.
Console.WriteLine(
System.Environment.OSVersion
);
- Without 8.1 ID on 8.1
- Microsoft Windows NT 6.2.9200.0
- Without 10 ID on 10
- Microsoft Windows NT 6.3.9600.0
- With 10 ID on 10
- Microsoft Windows NT 10.0.10049.0
If you have an app.manifest just add the <supportedOS Id/>
you are missing.
Otherwise just Add new item to the project, search for manifest and choose Application Manifest File
with file name app.manifest
Basically your .csproj
should include (should just work if you add an Application Manifest File
with file name app.manifest
)
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
and
<ItemGroup>
<None Include="app.manifest" />
</ItemGroup>
I added
supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"
to my app.manifest, however my application is still recognising Win10 as Win6. Any ideas?