Inheritance security rules violated by type..

21 views
Skip to first unread message

Robert Friberg

unread,
Jan 22, 2019, 4:03:17 PM1/22/19
to ELMAH
Looks like I have a version mismatch somewhere.. anyone recognize the following exception or how to go about debugging?
This is on a new Azure VM running Windows Server 2016, IIS 10, .Net Framework 4.6.1
The application is an ASP.NET Mvc 5 and I added a nuget ref to elmah.io 
Looking closer I can see that Elmah assembly has a dependency on System.Web 2.0 but .NET Framework 4.6.1 has 4.0

[TypeLoadException: Inheritance security rules violated by type: 'System.Net.Http.WebRequestHandler'. Derived types must either match the security accessibility of the base type or be less accessible.]
   Microsoft.Rest.ServiceClient`1.CreateRootHandler() +0
   Microsoft.Rest.ServiceClient`1..ctor(DelegatingHandler[] handlers) +59
   Elmah.Io.Client.ElmahioAPI..ctor(DelegatingHandler[] handlers) +96
   Elmah.Io.Client.ElmahioAPI..ctor(ServiceClientCredentials credentials, DelegatingHandler[] handlers) +70
   Elmah.Io.Client.ElmahioAPI.Create(String apiKey, ElmahIoOptions options) +146
   Elmah.Io.Client.ElmahioAPI.Create(String apiKey) +91
   Elmah.Io.ErrorLog..ctor(IDictionary config) +109
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +217
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1431
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +184
   System.Activator.CreateInstance(Type type, Object[] args) +34
   Elmah.ErrorLog.GetDefaultImpl(HttpContext context) +178
   Elmah.ServiceCenter.GetService(Object context, Type serviceType) +17
   Elmah.ErrorLog.GetDefault(HttpContext context) +34
   Elmah.ErrorPageBase.get_ErrorLog() +39
   Elmah.ErrorLogPage.OnLoad(EventArgs e) +400
   System.Web.UI.Control.LoadRecursive() +154
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4082

Thomas Ardal

unread,
Jan 22, 2019, 4:06:18 PM1/22/19
to ELMAH
Hi Robert

Please contact elmah.io support, by going to https://elmah.io and contact me through the chat widget in the lower right corner. This group is for ELMAH (the open source project) in general.

Thomas

Atif Aziz

unread,
Jan 22, 2019, 4:06:21 PM1/22/19
to el...@googlegroups.com
elmah.io isn't ELMAH.
You'll want to contact the elmah.io folks (@elmah_io) instead.

--
You received this message because you are subscribed to the Google Groups "ELMAH" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elmah+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages