Failed to load type 'Elmah.ErrorLogModule' from assembly 'Elmah'

I basically downloaded the Elmah builds and installed the package using the NuGet plugin. I remember that he worked with one of my projects, but suddenly he stopped working with

"Failed to load type 'Elmah.ErrorLogModule' from assembly 'Elmah'.

and this is strange. It worked. In any case, I did not find many solutions for this on Google, but I think that people have encountered this problem before. some have suggested that this is a 32-bit version of a 64-bit version.

Any suggestions?

+4
source share
5 answers

This can happen if Elmah was manually added before and the assembly binding in web.config refers to a specific version:

It -

<modules> <add name="ErrorMail" preCondition="managedHandler" type="Elmah.ErrorMailModule, Elmah-1.1"/> <add name="ErrorLog" preCondition="managedHandler" type="Elmah.ErrorLogModule, Elmah-1.1"/> <add name="ErrorFilter" preCondition="managedHandler" type="Elmah.ErrorFilterModule, Elmah-1.1"/> </modules> 

It must be -

 <modules runAllManagedModulesForAllRequests="true"> <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" /> <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" /> <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" /> </modules> 
+2
source

Actually, guys, it turned out that this was a stupid reason. It stopped working because I used the same name Elmah for my project as an assembly.

It made everything stop working. Really stupid mistake.

+4
source

"I remember that he worked with one of my projects , but suddenly he stopped ..."

You have a NuGet Elmah package for each project using it.

+2
source

Try using the assembly binding viewer (Fuslogvw.exe) to find out why the assembly was not found and what locations .NET took. See http://msdn.microsoft.com/en-us/library/e74a18c4.aspx for more details.

+1
source

The same thing happened to me and checked many solutions, and now I just changed the name of the project, then it works fine, so do not add the name of your project to "elmah" , because it will conflict with the namespace elmah.

By posting information here.

0
source

Source: https://habr.com/ru/post/1385035/


All Articles