I tried googling, but this is way too specific and unique of a question for a google search to solve.
My game is using a .dll library, which is precompiled, and this .dll library has assembly reference to Microsoft.DirectX (It’s very old). Now, in-editor Play Mode it works fine (If I disable Validate references mind you), but it just won’t let me build. Any help or bypass? Where can I get those assemblies to include in my projects? I found them in Windows/Assembly folders, but those are not .dlls that I could copy.
I did try to download the dlls separately, but it won’t solve the issue. Any help?
Note, when I try to put the direct x .dll files (Sourced on the internet) I get this error:
Could not load image C:\Users\Madatek\source\repos\FCAdventureModeMod\Assets\Plugins\Microsoft.DirectX.Direct3D.dll due to Invalid VirtualSize points beyond EOF
Run the peverify utility against this for more information.
What does the DLL do for you? Have you tried decompiling it and just using the endpoint(s) you need? I assume this DLL doesn’t actually meaningfully use DirectX… does it?
I don’t think I would have the permission to decompile the .dll, while I don’t use anything that uses DirectX, I tried to include it in other applications and it works fine… if only I could add an assembly reference through Visual Studio…
OK so I did decompile the reference, and I guess I will try removing anything to do with Direct3d, hopefully I won’t piss off the authors
Edit: nevermind it won’t be possible, as soon as I removed the references from there I realized why
Nevermind, I got confused with those “advancements”, as the project that used the .dll doesn’t do those steps, and Unity removes my assembly references from Visual Studio the first chance it gets. I am lost, this is the last step before I could build, I have no idea what to do
Just FYI: you can’t just use any DLL in a Unity project. It needs to be compatible with the Mono framework, possibly with IL2CPP depending on the platform, and must not interfere with other Unity APIs ie rendering.
So unless a DLL is marked as compatible or known to be compatible on a given platform (ie some Win32 stuff) it may not work in general.