none
IL Rewrite fails to load .Net DLL RRS feed

  • Question

  • I have built the IL Rewriter for some custom requirement. All it does is

    1. Creates method references for another .Net DLL (newly built custom DLL)
    2. Inject epilogue & prologue for few required methods, they internally call above method references.

    Everything works fine with sample Windows form application. However, for the web application, epilogue & prologue are getting injected properly. But, when it gets called, it throws below error -

    System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

    Somehow, the newly built .Net DLL is not getting loaded for WebApp, while the same is working fine for Windows App.

    If I disable IL Rewrite, everything works fine as expected. That means IL Rewrite is causing the error.

    Any solution would be much appreciated


    Hitesh

    Thursday, November 16, 2017 4:25 PM

All replies

  • Hi Hitesh Kesharia,

    For your question, I found that your question has been solved by yourself with the solution below.

    Change

    COMPLUS_LoaderOptimization 

    to 

    1

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, November 20, 2017 6:18 AM
    Moderator