'System.ArgumentException'发生在System.Data.Entity.dll for Entity MyBase.New在PFModel.Designer.vb [英] 'System.ArgumentException' occurred in System.Data.Entity.dll for Entity MyBase.New in PFModel.Designer.vb

查看:238
本文介绍了'System.ArgumentException'发生在System.Data.Entity.dll for Entity MyBase.New在PFModel.Designer.vb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到这个错误:


System.Data中发生了类型为System.ArgumentException的第一次机会异常
.Entity.dll

A first chance exception of type 'System.ArgumentException' occurred in System.Data.Entity.dll

在我的实体模型中添加一个新的属性。

After adding a new property in my entity model.

这是在尝试添加新的模块级别对象后发生的。

This occurs after trying to add a new module level object

Private mdbContext As New PFModelContainer

然后转到

Public Sub New()
        MyBase.New("name=PFModelContainer", "PFModelContainer")

哪里去错误并停止。在创建该属性之前,我已经添加了该属性,然后

Where it goes to the error and stops. It worked before I created the property but after I added the property and


生成数据库模型...

generate database model...

从我的实体模型。

我已经尝试重新安装VB.NET Express,我已经尝试删除designer.vb,然后删除edmx.sqlce,然后重新创建它们,但没有帮助。

I've tried reinstalling VB.NET Express and I've tried deleting the designer.vb and deleting edmx.sqlce and then recreating them but that hasn't helped either.

任何建议。我看过互联网,但没有发现任何有用的这个问题。感谢高级!

Any suggestions. I've looked on the internet but haven't found anything useful for this problem. Thanks in advanced!

推荐答案

确定,原来我需要通过右键单击edmx模型来更新tt模型,按

OK, it turns out that I need to update the tt model by right clicking in the edmx model and pressing


添加代码生成项

Add Code Generation Item

然后


ADO.NET DbContext生成器

ADO.NET DbContext Generator

我想我以前做过,但我不记得这样做。

I suppose I did it before but I don't remember doing it.

这篇关于'System.ArgumentException'发生在System.Data.Entity.dll for Entity MyBase.New在PFModel.Designer.vb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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