I’m new to MVC and am trying to set-up a basic template application. From VS2010 I’m creating the template MVC2 project. However, I’ve noticed that the database is 开发者_StackOverflowsometime not created as part of the template. Are there any rules to when or where this creates its own database, or why it might not do so?
The standard MVC template has a connectionstring in the web.config pointing to a aspnetdb.mdf database in the App_Data folder.
The default MVC 2 Web Application template uses the database for authentication (through the AccountController).
The physical file gets created on first use; probably when you register an account or attempt a logon while running the application.
精彩评论