MVC更新.edmx文件(.msl,.csdl,.ssdl) [英] MVC updating .edmx files (.msl, .csdl, .ssdl)

查看:448
本文介绍了MVC更新.edmx文件(.msl,.csdl,.ssdl)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的根目录中有3个.edmx文件(.msl,.csdl,.ssdl)。当我从数据库更新模型时,为什么不更新?

I have 3 .edmx files (.msl, .csdl, .ssdl) in my root project directory where the web.config is. Why are these not updating when I do a 'update model from database'?

我必须手动将新的字段添加到这些文件...

I have to manually add the new fields to these files...

推荐答案

.msl,.csdl和.ssdl是.edmx编译的结果,如果没有将它们嵌入到程序集检查中,在.edmx文件属性(在解决方案资源管理器中)中为Build Action选择了EntityDeploy,并且在模型属性(模型设计器)中为元数据人工处理选择复制到输出目录,更新模型并重新构建解决方案。之后,他们将被复制到bin \Debug子文件夹。

.msl, .csdl and .ssdl are result of .edmx compilation, if you do not embedd them into assembly check that "EntityDeploy" is selected for "Build Action" in .edmx file properties (in Solution Explorer) and "Copy to Output Directory" is selected for "Metadata Artifact Processing" in model properties (in model designer), update your model and rebuild solution. After that they will be copied to bin\Debug subfolder.

BTW,您可以选择Embedd into Output Assembly,更新连接字符串,删除对这些文件的引用解决方案,不用再关心他们了。

BTW, you could select "Embedd into Output Assembly", update connection string, remove references to these files from solution and do not care about them anymore.

这篇关于MVC更新.edmx文件(.msl,.csdl,.ssdl)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆