Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Missing implementation of System.OperatingSystem.IsWindows #8347

Closed
teobugslayer opened this issue Sep 22, 2020 · 2 comments
Closed

Missing implementation of System.OperatingSystem.IsWindows #8347

teobugslayer opened this issue Sep 22, 2020 · 2 comments

Comments

@teobugslayer
Copy link
Contributor

Hi all,

I am trying to write cross-platform code and my attempt to use IsWindows and IsWindowsVersionAtLeast fails:

  Generating native code
EXEC : warning : Method `[ZX]ZX.ConsoleDisplay.Init(int32,int32)` will always throw because: [TEMPORARY EXCEPTION MESSAGE] MissingMethod: Boolean System.OperatingSystem.IsWindows() [C:\Dev\ZX\ZX\ZX.csproj]
EXEC : warning : Method `[ZX]ZX.Program.ValidateCanRun()` will always throw because: [TEMPORARY EXCEPTION MESSAGE] MissingMethod: Boolean System.OperatingSystem.IsWindowsVersionAtLeast(Int32, Int32, Int32, Int32) [C:\Dev\ZX\ZX\ZX.csproj]

What are my options to rectify the problem?

@MichalStrehovsky
Copy link
Member

Number of .NET 5 APIs are not available in CoreRT right now because we stopped synchronizing them with the runtime due to technical difficulties a couple months ago.

This will be resolved once this repo is fully migrated to dotnet/runtimelab (dotnet/runtimelab#4) where the managed APIs are already fully synchronized with the mainstream runtimes. We just don't have official builds and packages yet.

For now you need to stick to .NET 3.1 APIs.

@jkotas
Copy link
Member

jkotas commented Oct 17, 2020

Fixed in dotnet/runtimelab. Update your nuget feed to the one in https://github.com/dotnet/runtimelab/tree/feature/NativeAOT/samples/HelloWorld

@jkotas jkotas closed this as completed Oct 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants