Search code examples
c#libcurlwin64

libcurl .NET does not want to work on Win64


I wrote multi-threaded FTP uploader on C#.NET using libcurl.NET.

Everything works fine on my machine, but when I give application (exe + libcurl.dll + 2 libcurl C# binding DLLs) to my friend who is running Win64, application crashes.

After adding exception catcher to whole Main() function, I was able to get readable error message: "An attempt was made to load a program with an incorrect format (Exception from HRESULT = 0x8007000b)"

After googling for a while, I found an advice to enable unmanaged code in my project settings. I've recompiled my application and LibCurlNet.dll with this flag set but it did not help.

What can cause such problem?


Solution

  • The libcurl.NET library is a 32bit library, so it can't be used by a 64bit application. You need to recompile your application to target the x86 platform. This will cause it to run as a 32bit app under WOW64 on 64bit operating systems.