Last night I've update asp.net mvc to 4 version in my project. I'm using FluentSecurity version 1.4. After references were updated, and I ran security tests and got the exception:
System.Security.VerificationException : Method FluentSecurity.ConfigurationExpression.For: type argument 'MvcApplication1.Controllers.HomeController' violates the constraint of type parameter 'TController'.
Should add to test library app.config for fix this problem. App.config:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
And now all tests pass.