[英]Moving Entity Framework projects
I have developed a project using entity framework on my local machine. 我已经在本地计算机上使用实体框架开发了一个项目。 What I am wondering is what is the best way to move the project to live server.
我想知道的是将项目移至实时服务器的最佳方法是什么。 Do I need to recreate the entities on the live server, if tables are same?
如果表相同,是否需要在实时服务器上重新创建实体? Or I need to change the connection string?
还是我需要更改连接字符串? Reason why I am asking is that on live server I might not have access to the Visual Studio to re create entities.
我问的原因是,在实时服务器上,我可能无法访问Visual Studio来重新创建实体。 I searched around cant find what I am looking for.
我到处搜寻找不到我想要的东西。 Appreciate your comments.
感谢您的评论。
You need to create the database and objects on the server manually. 您需要在服务器上手动创建数据库和对象。 You could export the DB schema to a SQL script through Management studio.
您可以通过Management Studio将数据库模式导出到SQL脚本。
Also ensure that you get rid of the DropCreateDatabaseIfModelChanges
strategy, which might be the case on your development environment- especially if you are using rapid prototyping. 还要确保您摆脱了
DropCreateDatabaseIfModelChanges
策略,在您的开发环境中可能会发生这种情况,尤其是在使用快速原型制作时。
If your connection string is externalized to web.config, donot forget to change that as well. 如果您的连接字符串已外部化到web.config,请不要忘记也进行更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.