LINQ problem: it is not possible to list an object of type "System.Reflection.Module" to enter "System.Reflection.Emit.ModuleBuilder

I have a simple lambda expression that works great as a UNIT test, and also works great when copying code to the main method of my application. However, when I run the same piece of code in the callback method (via JMS courier), I get the above error. Has anyone come across this?

Example code error:

Expression<Func<JupiterDividend, bool>> expr = v => true; expr.Compile(); // This is what fails 
+4
source share
2 answers

Usually you get this error when ModuleBuilder is already “compiled” or TypeBuilder is already “compiled”.

I would see where such things happen. In addition, stack tracing may be convenient in this case.

+2
source

There is a bug report here , but not sure though, if that is the problem you are having. Apparently this has been fixed in .NET 3.5 SP1.

-1
source

Source: https://habr.com/ru/post/1277693/


All Articles