BadFormatImageException is an error that you get when your program is compiled for 32-bit architecture and tries to load a 64-bit library or vice versa. From this error, you are referencing log4net (a well-known log library).
First , check which processor you are creating for your application (x86, x64, AnyCPU)
Second , check the bit size of log4net (you need to specify the same bitt of your applications)
Third , check that IIS is running. (if x64 and your application are 32, set the "Enable 32-bit applications" parameter to true in the advanced settings section of the application pool)
Steve source share