Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
I am gettinG a error that is "Could not load file or assembly 'log4net' or one of its dependencies. An attempt was made to load a program with an incorrect format.".Some body used the project before.We are not using a log4net.dll there in the bin folder in our application.but log4net.dll is there in the pjct.I tried many things but it is not working .
Posted
Comments
DamithSL 8-Jun-14 1:55am    
have you try to install log4net via Nuget
https://www.nuget.org/packages/log4net/[^]

1 solution

Hi,
Just remove it from the dll from your project and then try to build the project. Since you don't need that one.

In case you want to include that dll, you should check that, the application pool you are using is compatible with the assembly. I have encountered these kind of errors in my past. Please check that dll is 32 or 64 bit. If it is 32 bit, then open the IIS and select the respective app pool and go to "Advanced setting" and "Enable 32-bit Applications" to "True".

Hope this helps!
S Francis
My ASPDotNet Blog
 
Share this answer
 
Comments
ali_1 9-Jun-14 4:28am    
I removed the log4net.dll from reference.but after rebuilt it is showing in the bin folder.why?There no occurrence of log4net.dll any where in my project.Any where else that I need to check ??
ali_1 11-Jun-14 0:18am    
I removed log4net.ddl from reference.Still getting the same error
"Could not load file or assembly 'log4net' or one of its dependencies. An attempt was made to load a program with an incorrect format" .
Also changed the built platform to AnyCPU.but after rebuilting the application log4net is showing in the bin folder.ANy where else in which I need to remove the log4net?? .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900