I want to generate some CSS files dynamically in the Content folder.
There is currently an ignore route in this folder ( routes.IgnoreRoute("Content/{*wildcard}"); ), and I would like it to stay as I don't need / want most of my content folders to go to MVC request life cycle.
Example:
routes.MapRoute( "DynamicCSS", "Content/Css/Dynamic/{guid}.css", new { controller = "Site", action = "GenerateCSS" }, new { guid = @"^([0-9a-fA-F]){8}([0-9a-fA-F]){4}([0-9a-fA-F]){4}([0-9a-fA-F]){4}([0-9a-fA-F]){12}$" } );
I have a couple of questions / issues related to this setting:
- Will this work? Routes in ASP.NET MVC are lazy, but I donβt know if ignore routes are checked first. There is no documentation (I'm Googled!) In this form of use.
- Are there any security implications when enabling
RouteExistingFiles ? I do not want IIS to collect any of my Model / Views folders by referencing them directly.
Thanks so much for any suggestions.
Edit:
After further research, I found an article on my first problem.
source share