'System.ArgumentException' occurred in System.Data.Entity.dll for Entity MyBase.New in PFModel.Designer.vb

别来无恙 提交于 2019-12-11 22:46:10

问题


I received this error:

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

Which then goes to

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...

from my entity model.

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!


回答1:


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

Then

ADO.NET DbContext Generator

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



来源:https://stackoverflow.com/questions/7209121/system-argumentexception-occurred-in-system-data-entity-dll-for-entity-mybase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!