You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a soft prerequisite to #1044. That is, we could work around it in somewhat complicated ways... but let's not!
Our .NET 5.0 builds contain unguarded calls to Windows-specific apis like Registry.GetRegistryKey. They work because we don't actually call those APIs unless we have verified that we are running on Windows.
Once we introduce .NET 6.0 builds, the default settings will result in errors for those calls. While we could suppress those checks, it makes more sense to go ahead and start using guard statements like if (OperatingSystem.IsWindows()) before such calls.
In addition, we should probably isolate such code in separate methods and apply SupportedOSPlatformAttribute to them.
The text was updated successfully, but these errors were encountered:
This is a soft prerequisite to #1044. That is, we could work around it in somewhat complicated ways... but let's not!
Our .NET 5.0 builds contain unguarded calls to Windows-specific apis like
Registry.GetRegistryKey
. They work because we don't actually call those APIs unless we have verified that we are running on Windows.Once we introduce .NET 6.0 builds, the default settings will result in errors for those calls. While we could suppress those checks, it makes more sense to go ahead and start using guard statements like
if (OperatingSystem.IsWindows())
before such calls.In addition, we should probably isolate such code in separate methods and apply
SupportedOSPlatformAttribute
to them.The text was updated successfully, but these errors were encountered: