Dll Not Loading In Python
Solution 1:
When trying to reproduce this, got the same behavior. But the reason is really simple - most likely your .NET project, like mine, is targeting AnyCPU. Since we are trying to create unmanaged export - we need separate versions for x86 and x64. So to resolve your problem - just target x86 for your .NET assembly for example. Here is how I found that out (this info might be useful as well): in Visual Studio go to Tools > Options > Projects and Solutions > Build and Run. There you will see MSBuild output verbosity level - set that to Diagnosts. Then build your project and among other stuff you will see:
Skipped method exports, because the platform target is neither x86 nor x64. Set the MsBuild property 'NoDllExportsForAnyCpu' to false if you want to create separate versions for x86 and x64. (e.g. you can do that in the package manager console: Set-NoDllExportsForAnyCpu -value $false) (TaskId:35)
Post a Comment for "Dll Not Loading In Python"