Muhafil Saiyed
Muhafil Saiyed

Reputation: 230

Using Membership in ASP.Net MVC throws exception

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."

enter image description here

enter image description here

Upvotes: 0

Views: 97

Answers (2)

Mansi Buch
Mansi Buch

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

PepitoSh
PepitoSh

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

Related Questions