質問

I have built a new dll in the platform builder and trying to use this dll in my app. When I'm using this dll in my app I'm getting an error: Can't find PInvoke DLL 'HardwareAbstractionLayer.dll'.

What this error means and how can I resolve the problem?

役に立ちましたか?

解決

What this error means is quite easy: It simply can't find the desired DLL on the system to load it. So please ensure that your file is really available on the device by checking it with the explorer.

If the file is baked into your image and really on the desired place you like it (correct folder?) you should ensure that your application really searches on the right place for the DLL. Does it look only into its own working directory or only into the windows folder?

To ensure the file is available for your application write another small utility program that doesn't reference to your DLL. Instead simply use some Directory.GetFiles() call to ensure that the file is also reachable from your application.

If all of these are checked, then maybe the DLL is compiled for the wrong platform? Ensure that it is set to the correct cpu type and also check if your DLL itself has any dependencies and that these are also all available on the target.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top