Loader lock error

后端 未结 9 1606
孤独总比滥情好
孤独总比滥情好 2020-12-02 07:34

I am building on C++ dll, by writing code in C#.

I get an error, saying

LoaderLock was detected Message: Attempting managed execution insid

9条回答
  •  心在旅途
    2020-12-02 08:16

    I'm building a C++ CLR DLL (MSVS2015) that has to make calls into an unmanaged DLL and define unmanaged code. I use #pragma managed and #pragma unmanaged to control what mode it is in for a given area of the code.

    In my case I simply put #pragma unmanaged in front of my DllMain() and this solved the problem. It seemed to be thinking I wanted a managed version of DllMain().

提交回复
热议问题