I Get a "An Attempt Was Made to Load a Program with an Incorrect Format" Error on a SQL Server Replication Project

I get a An attempt was made to load a program with an incorrect format error on a SQL Server replication project

I've found the solution. I've recently upgraded my machine to Windows 2008 Server 64-bit. The SqlServer.Replication namespace was written for 32-bit platforms. All I needed to do to get it running again was to set the Target Platform in the Project Build Properties to X86.

An attempt was made to load a program with an incorrect format. ChilkatDotNet4. Not fixed by usual methods

After changing your windows service to x86 this will change the build directory to

..ProjectName\bin\x86\debug

Make sure your windows service is pointing at this directory otherwise you will be running your old (any CPU) version of the service.

If you service is not pointing at this x86 directory, uninstall and reinstall the service for the new directory

Could not load file or assembly ... An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

I am pretty sure you're having a 32-bit / 64-bit conflict. It sounds like your main project might be set to 32-bit while the class its referencing is set to 64-bit. Try looking at this SO question and this one too. Between the two of them, you should be able to figure out your problem.

UWP - SQLite - An attempt was made to load a program with an incorrect format

With the question suggestions by StackOverflow, I found my answer :

I had to allow 32-bit applications on my application pool in IIS. (I get a "An attempt was made to load a program with an incorrect format" error on a SQL Server replication project)



Related Topics



Leave a reply



Submit