0
votes

I'm using webmarkupmin library to minimize the html output of a asp.net site. The problem is that when I publish in godaddy hosting I get the following error:

Inheritance security rules violated while overriding member: 'WebMarkupMin.Core.CodeProcessingException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.TypeLoadException: Inheritance security rules violated while overriding member: 'WebMarkupMin.Core.CodeProcessingException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[TypeLoadException: Inheritance security rules violated while overriding member: 'WebMarkupMin.Core.CodeProcessingException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.]
   WebMarkupMin.Core.GenericHtmlMinifier.Minify(String content, String fileContext, Encoding encoding, Boolean generateStatistics) +0
   WebMarkupMin.Core.HtmlMinifier.Minify(String content, String fileContext, Encoding encoding, Boolean generateStatistics) +24
   WebMarkupMin.AspNet4.WebForms.Components.MinifiedComponentBase.Render(HtmlTextWriter writer, Action`1 renderHandler) +387
   WebMarkupMin.AspNet4.WebForms.MinifiedMasterPageBase.Render(HtmlTextWriter writer) +65
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +13
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1303

I've read that I could add this line [assembly: SecurityRules(SecurityRuleSet.Level1)] to the assambly, but I don't have the source code of WebMarkupMin to modify it and make it work so question here is, do you have any idea how to fix it?

Thanks!

1

1 Answers

1
votes

Just added a full trust tag in web.config

<system.web>
    <trust level="Full" />
</system.web>