BL Coding TaleWorlds.Native.dll not accessable by Visual Studio 2019 Community

Currently viewing this thread:


Hey guys,
just started modding Bannerlord and I wanted to follow the tutorial given at "".
I have some basic understanding of programming, even I coded in Java the most of the time 'till now.

I did anything as described there, and also understood more or less what everything is for.

But while trying to set the references, a error occured at the "TaleWorlds.Native.dll" file. I am unable to set the reference:

"A reference to 'D:\Programme(x86)\Steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.Native.dll' could not be added. Please make sure this file is accessible, and that it is a valid assembly or COM component."

At first I ignored it, since I just wanted to start, you prob. know what I mean.
But while debugging/starting the same mistaked occured. Or at least, a mistake I think is of the same kind:

"The program '[19604] Bannerlord.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'."

I checked if the .dll is blocked. It's not.
I run the sfc/scannow. It found a mistake - but not fixed it.

Any other .dll-reference is working as it should.



no, but I found the reason:

The Native.dll is not a c#-dll.

That means, you dont need to use it anyway, and a VS c# obv. can't read a not c# .dll.

I have no clue how I fixed the "Access violation", error, but I didn't faced it again.

Upvote 0


VS c# obv.
Not quite. You can have non C# dll references in Visual Studio - you can also code in C++ as well.

But yes, if you are decompiling or referencing anything Native.dll has, then don't. It's not related to modding and it's not C# DLL.
If you mistakenly referenced it, then you can simply remove it from list by right click.
Also, should be obvious but some times can slip away, make sure that no launcher or Bannerlord related process is running. Programs can lock dll's and restrict your access as well ( Some times BetterExceptionWindow is causing Launcher to run in Resource window, for example. If you want to make sure nothing is running, check it from Resource Window, not task manager )
Upvote 0


You can have non C# dll references in Visual Studio - you can also code in C++ as well
Well yea of course,
But only if you installed not only Visual Studio C# IDE, but also the C++ IDE.
I am quite sure, VS can work with a lot of things, as long as you installed the packages for making the IDE work.

Since I did only install the C# packages, it can't decompile the Native.dll for me.

Upvote 0
Top Bottom