-
Notifications
You must be signed in to change notification settings - Fork 154
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
ExecutionEngineException in RegisterWebApiControllers #508
Comments
Which version of Simple Injector are you using and have you tried upgrading? |
4.0.12 |
Some users reported getting ExecutionEngineExceptions, but that issue has been fixed with #274 by disabling If you're accidentally enabling However, if you leave Please make sure that you aren't setting You can check this by looking at a crash dump (example). The stack trace will reveal whether the error originates from Simple Injector. If it does, please post the stack trace. |
Ok thanks for the quick response, I'll get back to you on that stack trace, or close the issue if SI is not implicated in it. |
In case Simple Injector is not involved, it would still be good to explain what caused the problem, in case others are having the same issue. |
Here's what I managed to get after taking a dump when w3wp crashed and analyzing with DebugDiag:
These exceptions were listed as well: Cannot create an instance of abstract type |
That seems like a weird stack trace. Are you sure this is where the If it is the source, what you can see it that it is actually the It would be interesting to find out which assembly is it is that |
I can't seem to get a dump of exactly when the exception happens, when I try doing that, it just hangs the system indefinitely, never creating the dump. I'm only able to take the dump immediately after the crash happens and IIS is starting to shutdown. Two things stand out to me, the above stack trace is indeed the one where the I've attached the analysis if you have any interest in taking a look. Also, I've verified that |
Getting a bit closer, got the real reason for the exception now:
and it's definitely from GetTypes() as you said .. now just gotta track down the assembly and type. |
Do note that even when Simple Injector generates an assembly, this will not cause the /bin folder to change. That assembly will only live in memory. There must be some other tool causing this change. Might there be a virus scanner screwing things up here? |
No AV other than build in Windows Defender, and this is happening across at least 3 machines that I know of so far. |
Ok, built SI from source and using that in our project, I was able to see exactly where it's happening while debugging the w3wp crash in VS:
The type it's failing on is from our code, trying to figure out what's special about that type now. |
So the only interesting thing I can discern about this class of ours, is that it uses |
Turns out this is some nasty incompatibility between To fix it, I've had to do a combination of things:
So nothing at all to do with SI, but I appreciate the help! |
Wow, that's really nasty. I'm really glad you figured this out. In case someone else finds this page by googling, do you have any sources or references (such as MSDN, Stackoverflow or Github) that explain this problem? |
I pieced it together from a bunch of different threads, still not entirely confident on what the right thing to do is. dotnet/sdk#1647 (seems like a fix should be incoming for .net 4.7.2) |
Confirmation that the issue is real and that it should be fixed in the VS 2017 15.6 tooling: dotnet/sdk#1712 (comment) and then the above workaround should no longer be needed. |
This may have nothing to do with Simple Injector and something we're doing entirely wrong, but I am unable to troubleshoot this any further and was wondering if you could help.
Almost every time we build, and IIS reloads all assemblies, we get a crash in w3wp. Debugging always takes us to this line in one of our web apps' Global.asax:
Here's what happens before that line for context:
This only happens on dev machines, not Production, thankfully. But it's super annoying as it dings productivity.
Anecdotally, it started happening when we started converting some our of assemblies to .NET Standard 2.0 from .NET Framework. Our solution is now a mix of .NET 4.7.1 and .NET Standard 2.0 assemblies.
Do you have any suggestions on how we could get to the bottom of this?
The text was updated successfully, but these errors were encountered: