IL Rewrite to mscorlib crashing w3wp.exe

226 views Asked by At

I have built the IL Rewriter to monitor any file is being opened in ASP.Net WebApp. To do so, I am rewriting IL for a private method called 'Init' in FileStream class in mscorlib. Here, I inject the epilogue/prologue to register a custom callback.

Injection is working fine. Custom callbacks are also getting called whenever a file is getting opened in Windows Application.

But, when I do the same for ASP.Net web application, it keeps crashing with the following error -

System.ExecutionEngineException was unhandled Message: An unhandled exception of type 'System.ExecutionEngineException' occurred in System.Web.dll

I don't understand if it is working fine with .Net-based Desktop Application, then why it does not work with .Net-based web application i.e. ASP.Net. What is the difference between Web and desktop application?

Googled for above error does not yield any solution :(

0

There are 0 answers