Asp.net mvc can not work without App_Data
I'm us开发者_C百科ing a custom security (no membership provider). After the user logs in ... a folder "App_Data" with ASPNETDB.MDF gets automatically created ... on my local machine. If I deploy this to a remote server, it will not work due to security constraints on App_Data.
Even if I delete this folder and restart the application ... it is re-created, even though I removed all references to Membership/Roles/Profile providers ... Nothing used in code ... just the plain old FormsAuthentication.
How is this happening ?
There must still be a place in your code where Membership/Roles/Profile-service is being used. If the provider is not specified, Asp.Net uses the default => which creates the .mdf file.
Make it impossible in your development environment for the Asp.Net to create the .mdf file: E.g. remove all rights from that App_Data, put in a text file and rename it as ASPNETDB.MDF or something like that...
This way you get the crash in debug mode. Then you can see, what is the line that tries to use the service => which then makes use of the default provider => creates the DB-file.
精彩评论