Support MVC 5
Hi,very thanks for FluentSecurity.
Current version of FluentSecurity suppurt MVC 5?
Hi, yes it should work in MVC 5. However, it is untested and the current releases of FluentSecurity are all compiled against MVC 3. So you will need to add assembly redirects to your web and app config files.
@kristofferahl
One thing that you could do is to add a PowerShell script to your NuGet package to detect the major MVC version and add the necessary web.config elements if they are missing (as was done here), then this step wouldn't have to be done manually.
$mvc_version = $project.Object.References.Find("System.Web.Mvc").Version
Write-Host "MVC Version: $mvc_version"
if ($mvc_version -match '^4\.') {
Write-Host "Detected MVC 4"
Install-MVC4-Binding-Redirects
}
elseif ($mvc_version -match '^5\.') {
Write-Host "Detected MVC 5"
Install-MVC5-Binding-Redirects
}
You are welcome to use the pattern that safely adds missing web.config settings without duplicating them as well as the part that saves the changes with formatting.
I have found this to be much better than using web.config transforms to do the same because that approach can blindly duplicate existing settings.
@NightOwl888 That's awesome... I hope to start working on the next version on monday. Maybe I'll have a look at this as well if time allows. Thanks!
@kristofferahl, @NightOwl888 very thanks! i glad to working on the next version of FluentSecurity.
FWIW, I can confirm that Fluent Security 2.0 works with MVC4 and MVC5; I'm actively using it in a client app with no issues.
@tiesont Thanks for the feedback. Good to know it is running without any issues. And all you had to do was to add the assembly redirects?
@kristofferahl Correct. Granted, I'm not doing anything fancy, so I can't speak to everything working correctly, but authorization seems to function properly.