Skip to content
Snippets Groups Projects
Commit d0e7c6d0 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

Marshal.GetDelegateForFunctionPointer(IntPtr, Type) is obsolete in

netstandard
parent 32cb42e0
No related branches found
No related tags found
No related merge requests found
...@@ -134,7 +134,11 @@ namespace Grpc.Core.Internal ...@@ -134,7 +134,11 @@ namespace Grpc.Core.Internal
{ {
throw new MissingMethodException(string.Format("The native method \"{0}\" does not exist", methodName)); throw new MissingMethodException(string.Format("The native method \"{0}\" does not exist", methodName));
} }
return Marshal.GetDelegateForFunctionPointer(ptr, typeof(T)) as T; #if NETSTANDARD1_5
return Marshal.GetDelegateForFunctionPointer<T>(ptr); // non-generic version is obsolete
#else
return Marshal.GetDelegateForFunctionPointer(ptr, typeof(T)) as T; // generic version not available in .NET45
#endif
} }
/// <summary> /// <summary>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment