-
-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monitor not available in .NET Standard 2.0 #1557
Comments
That specific API requires Reflection to dynamically generate event handlers, something that is not available on .NET Standard 2.0. |
Please correct me if I'm wrong - it seems like that |
Thanks @Sergio0694 I think they'd run in Debug mode, but not in Release Mode still which is how we're running ours in the CI. So, I think we'd still hit the issue? @dennisdoomen thanks for the background, we just spent 15 minutes being confused trying to read the docs and not understanding why it was missing until we poked around the code. Would be handy to call that out in the docs, and keep the API surface the same for the implementations, but just throw a @Sergio0694 source generators in the future could help with these scenarios, eh? |
I slightly recall we tried that, but I'm not sure anymore. But if anybody is up to it, feel free to try. We are very open to contributors.
I'm not very fond of that. But I agree about the documentation. |
For reference, the original issue was #859 where we removed support for .netstandard as After we merged #861 the nuget was relisted with the note
I don't know if the case has changed for the much newer 4.6.0 or 4.7.0. |
Tried to see if referencing Made a test in UWP.Specs (UAP 10.0.19041.0) calling the
Looking inside of public DynamicMethod(...)
{
throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_RefEmitLightweight);
} |
UWP apps are 100% AOT and dynamic code generation is not supported, that is correct. The only reason why compiled LINQ expressions work, for instance, is that they have a special interpreter, but that is not available for just manually emitted IL. |
@Sergio0694 Thanks for the clarification. We support net47 and netcoreapp2.1, so according to the docs the implementations that might benefit from We'll update the documentation instead of adding a dependency only to throw a better exception before |
Description
Wanted to make use of Event assertions to count times that events fired, but seems like
Monitor
isn't available for .NET Standard 2.0?We're trying to do tests for UI components in our UWP library. This restriction doesn't seem to be called out in the docs. Is there a reason this isn't available for .NET Standard 2.0?
Expected behavior:
Able to use Event assertions as documented in all target frameworks/standards.
Versions
FYI @RosarioPulella
The text was updated successfully, but these errors were encountered: