I have a simple web site with one aspx page (Test.aspx
) showing Roles.Enabled
value which is set to false in Web.config
(attribute roleManager@enabled
).
Test.aspx:
<%@ Page Language="C#" %>
<%= Roles.Enabled %>
Web.config:
<?xml version="1.0"?>
<configuration>
<system.web>
<roleManager enabled="false" />
</system.web>
</configuration>
This outputs:
False
Which is expected.
However, when I add another file (a razor page), e.g. Test.cshtml
with no content inside (0 B), the aspx page suddenly outputs:
True
The output is not changed even if I remove the razor page from the site. I have to recycle the application pool and then it again outputs False
(the expected result).
It seems that the MVC module / handler factory changes the values for some unknown reason.
How can I tell the MVC runtime not to do that?