@kt_ said in Deploying a .net Core app:
@kt_ said in Deploying a .net Core app:
@Unperverted-Vixen said in Deploying a .net Core app:
@Magus said in Deploying a .net Core app:
@RaceProUK I find that .NET Standard is the one thing they're doing that does make pretty good sense. Core, not so much. If they deliver what they promised at Build, Standard will be the new PCL.
.NET Standard 1.0 - 1.6 were the new PCL. .NET Standard 2.0 is just going to cause frustration.
My understanding is that since it now exposes the entire .NET 4.6.1 API, you can reference "legacy" assemblies from .NET Standard 2.0 assemblies. But when you try to use them on .NET Core, you're going to get a bunch of PlatformNotSupportedExceptions at runtime (not even at compile time!).
Did I miss something?
Yes, you did. .NET Core 2.0 is supposed to support .NET Standard 2.0.
OH shoot, I stand corrected:
Is AppDomain part of .NET Standard?
The AppDomain type is part of .NET Standard. Not all platforms will support the creation of new app domains, for example, .NET Core will not, so the method AppDomain.CreateDomain while being available in .NET Standard might throw PlatformNotSupportedException.
The primary reason we expose this type in .NET Standard is because the usage is fairly high and typically not associated with creating new app domains but for interacting with the current app domain, such as registering an unhandled exception handler or asking for the application's base directory.
From: https://github.com/dotnet/standard/blob/master/docs/faq.md
On the other hand:
Will there be tooling to highlight APIs that don't work everywhere?
Our current focus is on providing APIs either as part of .NET Standard or as independent packages that sit on top of .NET Standard. In some cases, certain APIs will not be supported everywhere and throw PlatformNotSupportedException. While that isn't ideal, it's much simpler than the alternatives, which are:
Using #if, also called cross-compiling
Write complicated reflection code, also called runtime light-up
A simple if statement with a platform check is much easier to express. Of course, there are limits to this. Exceptions are only acceptable for corner cases to avoid the complexities above. We will generally not expose large set of APIs that aren't supported.
In the future, my hope is that we can provide tooling to help you with this, by, for example, providing Roslyn analyzers that can give you squiggles in the IDE.