-
Notifications
You must be signed in to change notification settings - Fork 235
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
Added support for NETSTANDARD 1.0+ and PCL Profile 151 #96
Conversation
@jchannon can you please test these changes as well :) I have this all working in our app. @grumpydev can we get this merged in :) |
@@ -4125,7 +4246,7 @@ public static Assembly Assembly(this Type type) | |||
} | |||
#endif | |||
// reverse shim for WinRT SR changes... | |||
#if (!NETFX_CORE && !NETSTANDARD1_5) | |||
#if (!NETFX_CORE && !PORTABLE && !NETSTANDARD1_0 && !NETSTANDARD1_1 && !NETSTANDARD1_2 && !NETSTANDARD1_3 && !NETSTANDARD1_4 && !NETSTANDARD1_5 || NETSTANDARD1_6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be !NETSTANDARD1_6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good eye, I've updated this.
@grumpydev can we get this merged :) |
Do we need all that extra reflection stuff? Also, don't seem to be using the _genericMethodCache - is that intentional (because reflection is cached internally now), or an oversight? |
@grumpydev yep it's a polyfil for netstandard 1.0-1.2 which doesn't have some of the types and may never but the functionality is there. It may be nice if 3 months down the road we remove all the compiler directives except net standard: https://oren.codes/2016/06/23/portable-is-dead-long-live-netstandard/ That could be an oversight... I'm not sure I never added that or touched it. |
This doesn't build for me... There's two definitions of
I assume Even after fixing that, there's still several build errors:
Do I need to add any additional references to get it working on .NET Standard 1.6? |
@@ -4125,7 +4246,7 @@ public static Assembly Assembly(this Type type) | |||
} | |||
#endif | |||
// reverse shim for WinRT SR changes... | |||
#if (!NETFX_CORE && !NETSTANDARD1_5) | |||
#if (!NETFX_CORE && !PORTABLE && !NETSTANDARD1_0 && !NETSTANDARD1_1 && !NETSTANDARD1_2 && !NETSTANDARD1_3 && !NETSTANDARD1_4 && !NETSTANDARD1_5 || !NETSTANDARD1_6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This always evaluates to true, !NETFX_CORE && !PORTABLE && !NETSTANDARD1_0 && !NETSTANDARD1_1 && !NETSTANDARD1_2 && !NETSTANDARD1_3 && !NETSTANDARD1_4 && !NETSTANDARD1_5
is true when NETSTANDARD1_6
is defined, and !NETSTANDARD1_6
is true when NETSTANDARD1_6
is not defined, so OR-ing them will always evaluate to true 😕
I think the ||
is supposed to be &&
.
Yeah, that should probably be changed to just !NETSTANDARD |
Also I worked out that I needed to add a reference to the |
The type extensions are only for 1.3 and above. That's why those were on there. |
Added support for NETSTANDARD 1.0+ and PCL Profile 151
I've tested this on .NET standard profiles 1.0-1.5 as well as PCL Profile 151.
Now you can target .NET standard 1.0 and have the basic functionality but as you up your .net standard you get more functionality :)