Reputation: 12619
When publishing my web application and then running it will return the error
"Could not load file or assembly 'BaseApplicationName' or one of its dependencies. An attempt was made to load a program with an incorrect format."
However if I run the application through debugging (f5) it runs correctly.
I guess what it comes down to is
what differences are there when running an application through debugging vs publishing it that would cause a problem like this?
When publising I have it set to delete all existing.
History of how it started... I added the 32 bit Oracle.DataAccess dll to my 64 bit system. It would not work and crash giving the same error as above but with the Oracle.DataAccess name instead of the baseApplicationName. I have since removed all references to it and removed the dll to try and get it to run without it once again.
Any advice?
Upvotes: 1
Views: 630
Reputation: 2049
I am not sure which version of VS you are using - but I have noticed in 2005 and 2008 problems with it hanging on to dependencies that are not longer used. It might still be referencing the Oracle DLL during the publication step, and a bitness problem (32 vs 64) would give the error you see.
If you can't see any reference to the Oracle file in VS I would open the *proj file in notepad and see if there is a hidden reference to it that might be pushed to the server when you publish.
HTH
Upvotes: 0
Reputation: 74250
You have a mismatch in your solution where you are mixing x86 with x64, the incorrect format message refers to trying to load a 64 bit dll from a 32 bit executable or vice versa.
Upvotes: 1
Reputation: 958
Have you tried to "Clean" your solution and then rebuild it?
Upvotes: 0