# DllNotfoundExeption

**URL:** https://discussions.unity.com/t/dllnotfoundexeption/602378
**Category:** Scripting
**Tags:** Scripting
**Created:** [October 21, 2015, 5:07pm UTC](https://discussions.unity.com/t/dllnotfoundexeption/602378 "2015-10-21T17:07:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![benjaminver89](https://avatars.discourse-cdn.com/v4/letter/b/e19adc/32.png) [@benjaminver89](https://discussions.unity.com/u/benjaminver89)
#### Post date: [October 21, 2015, 5:07pm UTC](https://discussions.unity.com/t/dllnotfoundexeption/602378/1 "2015-10-21T17:07:06Z")

</div>

I try to use an external hardware with my game.  
Manufacturer provided me a dll and a C# sample for Visual studio. I also get probleme to find dll.  
After installing c++ 2010 x86 redistributable, sample find dll and works well under visual studio.  
Now i try to use it in Unity 5.1.3. I get the DllNotfoundException.  
I try several topics, but not find something that works…  
Is somebody have a similar probleme?

---

<div class="post-metadata">

### Author: ![eisenpony](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/eisenpony/32/119985_2.png) [@eisenpony](https://discussions.unity.com/u/eisenpony)
#### Post date: [October 21, 2015, 6:00pm UTC](https://discussions.unity.com/t/dllnotfoundexeption/602378/2 "2015-10-21T18:00:44Z")

</div>

It’s a long thread but it might help if you’re stuck.

> **[DllNotFoundException for a DLL that is present](https://discussions.unity.com/threads/dllnotfoundexception-for-a-dll-that-is-present.332768/)**
>
> I'm compiling a native C++ DLL and using it as a plugin in a Unity game. After some work, my basic tests showed everything to be working fine; I was able to make calls to the DLL, pass information in both directions, and got expected results. I've...

---

<div class="post-metadata">

### Author: ![benjaminver89](https://avatars.discourse-cdn.com/v4/letter/b/e19adc/32.png) [@benjaminver89](https://discussions.unity.com/u/benjaminver89)
#### Post date: [October 21, 2015, 7:07pm UTC](https://discussions.unity.com/t/dllnotfoundexeption/602378/3 "2015-10-21T19:07:37Z")

</div>

I already tested a lot of solutions proposed in your link and put ddl in differents folder.

I also tried things like this :

```csharp
String currentPath = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process);
        String dllPath = Environment.CurrentDirectory + Path.DirectorySeparatorChar + "Assets" + Path.DirectorySeparatorChar + "Plugins";
        if(currentPath.Contains(dllPath) == false)
        {
            Environment.SetEnvironmentVariable("PATH", currentPath + Path.PathSeparator + dllPath, EnvironmentVariableTarget.Process);
        }

```

I tried to use dependency walker. but i’m not sure to understand: it seems that Dependency Walker searching for a lot of _ **-MS-Win-** _ dlls that should be in his own forder .

What is curious is that it works with the C# Sample that Manufacturer sent me.

---

<div class="post-metadata">

### Author: ![benjaminver89](https://avatars.discourse-cdn.com/v4/letter/b/e19adc/32.png) [@benjaminver89](https://discussions.unity.com/u/benjaminver89)
#### Post date: [October 21, 2015, 8:15pm UTC](https://discussions.unity.com/t/dllnotfoundexeption/602378/4 "2015-10-21T20:15:56Z")

</div>

Does unmanaged dlls works in Unity 5 free?

---

<div class="post-metadata">

### Author: ![eisenpony](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/eisenpony/32/119985_2.png) [@eisenpony](https://discussions.unity.com/u/eisenpony)
#### Post date: [October 21, 2015, 8:37pm UTC](https://discussions.unity.com/t/dllnotfoundexeption/602378/5 "2015-10-21T20:37:31Z")

</div>

Unfortunately, DllNotFoundException does not provide a lot of information about _which_ dll is not found. .net might be complaining about your dll or it might be complaining about another dependency. Dependency walker can help you figure out all the assemblies your application needs. The tough part is filtering out all the system assemblies that are in registered locations.

If you’re certain you know which assembly is causing the exception, I’d say give fuslogvw a shot, to see if you can find out why it can’t be laoded. Unfortunately, I’ve never tried using the fusion log tool on unmanaged assemblies, so I’m not sure it will provide useful debug information. As a last resort, you could try using Process Monitor to detect attempts to find/access your dll.

> [@benjaminver89](#):
>
> Does unmanaged dlls works in Unity 5 free?

I’m not sure about that. Hopefully someone else can clarify.

---

<div class="post-metadata">

### Author: ![benjaminver89](https://avatars.discourse-cdn.com/v4/letter/b/e19adc/32.png) [@benjaminver89](https://discussions.unity.com/u/benjaminver89)
#### Post date: [October 22, 2015, 3:15pm UTC](https://discussions.unity.com/t/dllnotfoundexeption/602378/6 "2015-10-22T15:15:33Z")

</div>

I also tried this tutorial :  
[http://ericeastwood.com/blog/17/unity-and-dlls-c-managed-and-c-unmanaged](http://ericeastwood.com/blog/17/unity-and-dlls-c-managed-and-c-unmanaged)  
but same result, i can’t find dll ☹

Edit : tutorial works thanks to : [Update to Unity 5, then DllNotFoundException: sqlite3 - Questions & Answers - Unity Discussions](http://answers.unity3d.com/questions/936011/update-to-unity-5-then-dllnotfoundexception-sqlite.html)
