Runtime error when referencing external library in Unreal Engine

I followed the steps from this tutorial:

https://wiki.unrealengine.com/How_to_Link_External_C_Libraries_.dll_.lib_With_Your_Project_%26_Package_With_Game,_Fast_And_Easy

I was able to successively reference the external c++ library and the project compiles just fine. However, at runtime, when I instantiate an object from external library, I get the following error:

Exception thrown at 0x00007FFD7244FD31
(mscordacwks.dll) in UE4Editor.exe:
0xC0000005: Access violation reading
location 0x0000000000000000. occurred
Source information is missing from the
debug information for this module

and the stack is:

mscordacwks.dll!ClrDataAccess::EnumMemDumpAllThreadsStack(enum
CLRDataEnumMemoryFlags) Unknown Non-user
code. Symbols loaded.
mscordacwks.dll!ClrDataAccess::EnumMemoryRegionsWorkerMicroTriage(enum
CLRDataEnumMemoryFlags) Unknown Non-user
code. Symbols loaded.
mscordacwks.dll!ClrDataAccess::EnumMemoryRegionsWrapper(enum
CLRDataEnumMemoryFlags) Unknown Non-user
code. Symbols loaded.
mscordacwks.dll!ClrDataAccess::EnumMemoryRegions(struct
ICLRDataEnumMemoryRegionsCallback
*,unsigned int,enum CLRDataEnumMemoryFlags) Unknown Non-user
code. Symbols loaded.
dbgcore.dll!GenGetProcessInfo(unsigned
long,struct _MINIDUMP_STATE *,struct
_INTERNAL_PROCESS * *,struct _LIST_ENTRY *) Unknown Non-user code. Symbols loaded.
dbgcore.dll!MiniDumpProvideDump() Unknown Non-user
code. Symbols loaded.
dbgcore.dll!MiniDumpWriteDump() Unknown Non-user
code. Symbols loaded.
UE4Editor-Core.dll!00007ffdb17e95fb() Unknown No
symbols loaded.
UE4Editor-Core.dll!00007ffdb17ded6a() Unknown No
symbols loaded.
UE4Editor-Core.dll!00007ffdb17d2865() Unknown No
symbols loaded.
UE4Editor-Core.dll!00007ffdb17e0864() Unknown No
symbols loaded. [External
Code] Annotated Frame

the line where the error occurs:

CSharpClassExposer* scharpClassExposer = nullptr;
scharpClassExposer = new CSharpClassExposer();

The external library that I am referencing is C++ CLI (managed C++) which further wraps C# dll and I am sure it has something to do with this. However, in my separate test project where I use the same managed library with native c++ console client instead of Unreal Engine, it all works fine.