Closed cvocvo closed 6 years ago
Assembly Binding Log Viewer is a good tool to use for troubleshooting assembly load and binding issues. If you can run under a debugger and inspect the FileLoadException.FileName
property of the exception that it can provide pointers to the offending library. Usually, these kinds of problems are also caused by bit-ness mismatch the library being loaded and the hosting process. In the past, I've seen people get into this sort of trouble by using the wrong 32-bit versus 64-bit version of the SQLite library.
Thank you for responding so quickly!! Interesting; I'll take a look at the log viewer. We're running a full SQL server with our projects set to compile as Any CPU with dev on x64 Windows 10 and hosting on x64 Server 2016. I think the issue is that I'm trying to add Stackify (nuget packages: StackifyLib and StackifyLib.Elmah). When I revert to a clean branch of Master and only install those I run into these errors.
Here's what I've got in my web.config (might be something misconfigured?)
Inside of <configSections>
Inside of <httpModules>
Inside of <modules runAllManagedModulesForAllRequests=”true”>
Inside of <configuration>
Does that all look okay?
I don't know anything about StackifyLib and StackifyLib.Elmah so can't comment about that. The assembly name in the type
attribute of the <errorLog>
element seems suspicious and malformed so I'd start there. It would coincide with the error message that the given assembly name or codebase was invalid.
Confirmed it's definitely that line; I commented out the malformed line and replaced it with what we had and Elmah loads fine. I'll follow up with their team to figure out what it should be.
<elmah>
<!--<errorLog type="Elmah.SqlErrorLog, Elmah, StackifyLib.ELMAH.StackifyErrorLog, StackifyLib.ELMAH" connectionStringName="ErrorLoggingDbDSN" />-->
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ErrorLoggingDbDSN" />
<security allowRemoteAccess="true" />
</elmah>
Thank you for all the help! If I do get a solution, I'll post it back here for future reference if anyone stumbles across this.
In case anyone runs across this; we enabled Elmah to work with Stackify (and retain access to ~/Elmah.axd
) with the following:
In our App_Start
we’ve got a Global.cs
class and we’re using this:
/// <summary>
/// This is an application hook that elmah calls when it logs an error.
/// We tie into this hook to also send the error our stackify retrace program
/// </summary>
/// <param name="sender">not used</param>
/// <param name="args">An elmah event that contains the exception that was thrown</param>
protected void ErrorLog_Logged(object sender, ErrorLoggedEventArgs args)
{
StackifyLib.Logger.QueueException(args.Entry.Error.Exception);
}
In web.config
:
<elmah>
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ErrorLoggingDbDSN" />
<security allowRemoteAccess="true" />
</elmah>
And any custom exceptions we were handling from other libraries, etc. we updated our elmah calls from:
Elmah.ErrorLog.GetDefault(HttpContext.Current).Log(new Elmah.Error(ex));
to this:
Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
This probably isn't necessary but is the nicer way to do it as of Elmah 1.2
@cvocvo Thanks for dropping in with notes on what worked for you. I'm sure it'll help out someone someday.
Hi there,
I'm running Elmah with packages from Nuget in an ASP.NET MVC app targeting .NET 4.6.2
When I navigate to ~/elmah.axd I encounter a YSOD (yellow screen of death) instead of the usual elmah page loading:
It's working in our master branch of our project, but my branch (where I've been updating Nuget packages) is running into issues. I've confirmed:
Any ideas how I can solve this?
Best, Chris