I have a maddening situation here with an MVC4
site. At the outset, you need to know it uses Windows authentication, and I also want to use simplemembership
roles (but I don't think this is working--but this is not the focus of my question). Basically, the site works on my dev
machine (with IIS
Express) and a test machine (with regular IIS
). But it doesn't work in production environment. We get an error "could not load file or assembly WebMatrix.WebData, version=2.0.0.0
.
The WebMatrix.WebData
reference has CopyLocal = False
. (This works in dev
and test
.) If I set CopyLocal = True
, then the authentication goes haywire. Specifically, when you visit the site, it attempts a redirect to login.aspx
(obviously not an MVC
component). So, my question is Why is this happening? How do I fix?
Here's what I've got under my system.web element in the config:
<roleManager enabled="true">
<providers>
<clear/>
<add name="simple" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData"/>
</providers>
</roleManager>
<membership>
<providers>
<clear/>
</providers>
</membership>
<authentication mode="Windows" />
I've played around with this quite a bit trying to understand the problem, but I don't really know what I'm doing with this config section/what all can be done. I wonder if there's a problem clearing all the membership providers.... while trying to use the SimpleRoleProvider
. (I tried cutting out SimpleRoleProvider
, but this had no effect on problem.)