2017-04-10 83 views
0

我正在使用webmarkupmin庫來儘量減少asp.net網站的html輸出。問題是,當我在godaddy的發佈舉辦我得到以下錯誤:WebMarkupMin重寫成員時違反了繼承安全規則

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)]添加到assambly,但我沒有WebMarkupMin的源代碼修改它並使其工作如此問題在這裏,你有任何想法如何解決它?

謝謝!

回答

0

在web.config中只是增加了一個完全信任標籤

<system.web> 
    <trust level="Full" /> 
</system.web> 
相關問題