【发布时间】:2017-04-11 22:12:03
【问题描述】:
我正在使用 webmarkupmin 库来最小化 asp.net 站点的 html 输出。问题是,当我在 godaddy 托管中发布时,我收到以下错误:
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
我已经读到我可以将这一行 [assembly: SecurityRules(SecurityRuleSet.Level1)] 添加到组件中,但我没有 WebMarkupMin 的源代码来修改它并使其工作,所以这里的问题是,你知道如何修好吗?
谢谢!
【问题讨论】: