Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.net mvc can not work without App_Data

I'm using 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 ?

like image 528
Jalal El-Shaer Avatar asked Nov 15 '22 12:11

Jalal El-Shaer


1 Answers

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.

like image 60
Ope Avatar answered Dec 19 '22 01:12

Ope