Reputation: 230
I am trying to use the membership for my MVC project. I have added references of
WebMatrix.Data 2.0.0.0
WebMatrix.WebData 2.0.0.0
When I try to run my project it throws an exception
"Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.OnConnectionOpened(System.Object, WebMatrix.Data.ConnectionEventArgs)' to access security critical method 'System.Web.WebPages.HttpContextExtensions.RegisterForDispose(System.Web.HttpContextBase, System.IDisposable)' failed."
Upvotes: 0
Views: 97
Reputation: 33
same case with me
"Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.OnConnectionOpened(System.Object, WebMatrix.Data.ConnectionEventArgs)' to access security critical method 'System.Web.WebPages.HttpContextExtensions.RegisterForDispose(System.Web.HttpContextBase, System.IDisposable)' failed."
Upvotes: 1
Reputation: 1836
The IIS process does not have rights to access your database. As a fix, make sure that the application pool identity user has access to the folder and files of your database.
Upvotes: 2