Providing a control generates a security exception in .Net 4

I have a problem with code that works fine in .NET 2.0 but gives this error in .Net 4.

Assembly (network): inheritance protection rules that are violated when the member is redefined: 'Controls.RelatedPosts.RenderControl (System.Web.UI.HtmlTextWriter). Ensuring the accessibility of the override method must match the security of access to the method overstated.

This is in DotNetBlogEngine. There were a few more security requirements in the code that .NET 4.0 didn't seem to like. I followed some of the tips I found on blogs (and here) and got rid of all other errors. But it still eludes me.

The core BlogEngine core is dllno longer set for security requirements and compiled for .NET 4.0.

This error is on the side of the site, trying to use dll. There are controls that invoke the method RenderControlwhile taking HtmlTextWriter. Apparently, the text editor now has several soft security attributes set on it.

Each of the controls implements a custom interface ( public interface ICustomFilter); there are no permissions or security requirements. The site fully trusts my local dev machine.

Update:

I tried various settings under the security namespace in .NET 4 I read here . I know that this is a change to the security of access to the code, but I do not understand why it does not work (or an error message).

+1
2

[: SecurityRules (SecurityRuleSet.Level1)]

ref: http://msdn.microsoft.com/en-us/library/dd233102%28VS.100%29.aspx

+1

, .net 4.0, - System.Web.ApplicationServices Core.

0

Source: https://habr.com/ru/post/1758386/


All Articles