问题
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