Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
in FAQ: CompleteFTP by (156k points)
closed by
Why does my extension throw BadImageFormatException?
closed with the note: Answered

1 Answer

0 votes
by (20.7k points)
Best answer
When you build your own extension DLL, it is possible to get the error

System.BadImageFormatException: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

This means that CompleteFTP is running under an older .NET runtime than what your extension is compiled with. By default, CompleteFTP is configured to run under .NET 2.0, but it can run under higher versions including 4.x.

There are two solutions:

1) Change the configuration file to enable CompleteFTP to run under .NET 4.x instead of 2.x

Edit the CompleteFTPService.exe.config and remove the following line:

<supportedRuntime version="v2.0.50727" />

leaving only the other supportedRuntime element as follows:

<supportedRuntime version="v4.0" />

(Add the v4.0 line above if that isn't in your release).

2) Compile your DLL for .NET 2.0.