Can the automatically generated . mdf database in App_data be used in production?

Asked

Viewed 235 times

2

The automatically generated database within the App_data folder in projects Asp.Net MVC and Web-Api can be used in production or is a test basis only?

1 answer

1


The problem of using this database is that Attachdbfilename is an exclusive property of SQL Server Express, it works only as a user instance and cannot be used by the network.

If you have control over the production SQL Server it is possible that you take the mdf and ldf files to attach them to your SQL Server server, but if you use a shared hosting this is usually not an option, in this case it will be easier for you to generate a script to create the same tables.

  • 1

    I would say that especially in Azure it should not work. Note that this way of using the database is done to facilitate the life of the programmer during development, in production the environment may be different, in the case of Azure I believe you should use SQL Azure, but I have no experience with it to indicate better.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.