문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top