UnauthorizedAccessException when accessing DLL


I’m facing the following error in Unity 4.5.3f3 on Windows 8.1 when trying to load a DLL:

UnauthorizedAccessException: Access to
the path
integration/Assets/’ is denied.
(System.String path, FileMode mode,
FileAccess access, FileShare share,
Int32 bufferSize, Boolean anonymous,
FileOptions options) (at
(System.String path, FileMode mode,
FileAccess access, FileShare share)
(wrapper remoting-invoke-with-check)
System.IO.File.Open (System.String
path, FileMode mode) (at
(System.String filename) (at
VRPNManager.ParseConfigFile () (at
VRPNManager.Start () (at

This is followed by:

VRPNManager.Update () (at

I have seen a lot of people having that problem in Windows 8.1 and the solutions that have worked for them don’t work for me. What I have tried so far:

  • Running Unity as administrator: didn’t work
  • Disabling antivirus (AVG): didn’t work
  • Checking the permissions of my Assets and VRPNWrapper folder (where the DLL is): I have even given permissions to Everyone and it doesn’t fix the problem.
  • I have even run auditpol /clear

I have even thought that Unity is not using my username when trying to access the DLL folder, but in that case, to what user I should gave permissions ?

I finally found the problem !

Actually those are two different problems:


Check that the error mentions a file operation and “C:/Users/Angela/GIT/UWYO/3DiA/NUI/Unity integration/Assets/”, the problem is that the library I’m using (VRPNWrapper) is trying to open that path as if it were a file, so the access is not denied for a matter of permissions, it is denied because the operation is illegal (opening a directory to read its contents). The solution was to configure that library with the correct filename that it was missing.


This is a misleading error message, Unity is not failing to find my DLL, it’s failing to load it. The reason is that this DLL depends on other DLLs that are not present in my system.
Using Dependency Walker helped me to understand the load chain and find which DLLs were missing.

I hope this information may guide others.