DllImport generates System.DllNotFoundException

前端 未结 4 1058
轮回少年
轮回少年 2021-01-06 01:29

I’m having some difficulties while trying to consume an unmanaged-code dll from my application (written in C# framework 4.0). I’m using the dll imp

4条回答
  •  既然无缘
    2021-01-06 02:02

    The root of C is one of the places UAC will not let you write. Sometimes unmanifested apps that ask to read from a protected area end up reading from the virtualized equivalent - and your DLL will not be there. Try moving the DLL to a different folder (not the root of C, not anything under Program Files) and see if that solves it. If it does, you can leave it there or (better) put a manifest on your app to prevent virtualization.

提交回复
热议问题