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
{{ message }}
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.
I tried to compile simple example with using of MakeGenericMethod:
classProgram{staticvoidMain(string[]args){
Console.WriteLine("\r\n--- Examine a generic method.");Typeex=typeof(Example);MethodInfomi= ex.GetMethod("Generic");MethodInfomiConstructed= mi.MakeGenericMethod(typeof(int));object[]oargs={42};
miConstructed.Invoke(null, oargs);MethodInfomiDef= miConstructed.GetGenericMethodDefinition();
Console.WriteLine("\r\nThe definition is the same: {0}",miDef==mi);}}publicstaticclassExample{publicstaticvoidGeneric<T>(TtoDisplay){
Console.WriteLine("\r\nHere it is: {0}", toDisplay);}}publicstaticclassExample{publicstaticvoidGeneric<T>(TtoDisplay){
Console.WriteLine("\r\nHere it is: {0}", toDisplay);}}}
but I get the exception below:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at HelloWorld.Program.Main(String[]) + 0xa7
at HelloWorld!<BaseAddress>+0x1557ee
Here I had read about RD.xml, so I added the next one:
I tried to compile simple example with using of
MakeGenericMethod
:but I get the exception below:
Here I had read about
RD.xml
, so I added the next one:but the result was the same
HelloWorld.zip
The text was updated successfully, but these errors were encountered: