Skip to content

Inheritance security rules violated with MVC5 #37

@lacoursieresimon

Description

@lacoursieresimon

I just upgraded from MVC 4 to 5 and this error appeared :

Inheritance security rules violated while overriding member: 'MvcMembership.TouchUserOnEachVisitFilter'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

It seems there is a problem with the 'MvcMembership.TouchUserOnEachVisitFilter' class in MV5.
From what I understand, the security level is not high enough for the new MVC5 security policy. I fixed some of the errors I had by updating PagedListPager and MvcMembership via the PMC.Could it be related to the fact that the AssemblyInfo.cs has this assembly line ?

[assembly: AllowPartiallyTrustedCallers] 

It seems to be related to the PagedListPager issue #68.
The line that causes the error is :

GlobalFilters.Filters.Add(new TouchUserOnEachVisitFilter());

Here is the whole code in the MvcMembership.cs file in App_Start

using System.Web.Mvc;
using MvcMembership;

[assembly: WebActivator.PreApplicationStartMethod(typeof(Seika_Tracker.App_Start.MvcMembership), "Start")]

namespace Seika_Tracker.App_Start
{
    public static class MvcMembership
    {
        public static void Start()
        {
            GlobalFilters.Filters.Add(new TouchUserOnEachVisitFilter());
        }
    }
}

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions