Hello guys I would like to share here my experience with error about running the ASP.NET MVC source. I run in trouble when I was trying to build the MVC 2 RTM source code with .NET 4. The compilation pass well but when I try to run an MVC Site and I was getting the following crazy exception:
Inheritance security rules violated while overriding member: ‘System.Web.Mvc.TempDataDictionary.System.Runtime.Serialization.ISerializable.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.
What is the solution ? 🙂 Yes the solution is (if you want not to change the source code of the MVC ) just build the assembly with 3.5 .NET Version and then fill free to reference it in ASP.MVC WebSite running under 4.0 .NET
Hope this will help someone that run in the same trouble like me 🙂