1

I got ASP.MVC application. I use entity framework with default configuration (no connection string provided) so it creates .mdf file in APP_DATA.

If I wanna move my project to another pc and try a clean depoly, should I remove this .mdf from APP_DATA?

2 Answers 2

2

If you want to try a clean deployment, then YES. If you copy the database file it will be reused and so the migrations are not run (again), as they are already applied.

Sign up to request clarification or add additional context in comments.

2 Comments

Thx. Is there any way to automatically delete all files that not belong to project? Like images that i uploaded in project folder?
Are you using a Version Control System? Because there you normaly do NOT check in such files => just get a "clean version" from the VCS on the new machine. If you do not use VCS I would recommend to do so (VS will normaly only add the requried files)...
1

Assuming that you are using Migrations in your project there should not be any problem.
on new machine you can use command
"Update-Database" in your visual studio package manager consol and it will create a new database tables on you new machine.

NOTE: it will only create database schema if you need data also to get copied on to new machine you need to use some export utility.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.