Errors at MicrosoftCommunityNo one can solve the problem. It seems that the foreign devils are not very good. No cnblogs are enthusiastic.
First, check the exception prompt:
JIT compiler encountered an internal limitation.
ProgramCode:
An exception occurred when running the delegate.
Code
Private Decimal Productkpidata (type, String Methodname, guid userid, Int Year)
{
VaR Cache = Httpruntime. cache;
If (Cache [methodname] ! = Null )
Return (Func < Guid, Int , Decimal > ) Cache [methodname]) (userid, year );
VaR dynamicmethod = New Dynamicmethod ( " Gan " , Typeof ( Decimal ), New Type [] { Typeof (Guid ), Typeof ( Int )}, Typeof (Analyzeresultbll). Module );
VaR ilgen = Dynamicmethod. getilgenerator (); // Il Generator
// Push parameters to the stack
Ilgen. emit (Opcodes. ldarg_0 );
Ilgen. emit (Opcodes. ldarg_1 );
Ilgen. emit (Opcodes. ldarg_2 );
Ilgen. emit (Opcodes. Call, type. getmethod (methodname, New Type [] { Typeof (Guid ), Typeof ( Int )}));
Ilgen. emit (Opcodes. Ret ); // End and Return Value
// Generate Delegation
Func < Guid, Int , Decimal > Gan =
(Func < Guid, Int , Decimal > ) Dynamicmethod. createdelegate ( Typeof (Func < Guid, Int , Decimal > ));
// Delegate to cache
Cache. insert (methodname, Gan );
//Call the delegate to return the result
ReturnGan (userid, year );
}
It is also a special reason for making such a junk method. If I am tired, I can't say it. I just stick it to the wrong part and stick it to the core of the problem.
If there are parameters and methods, other problems will be avoided. The core issue is exceptions. Permission? What is the solution?