Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
189 views
in Technique[技术] by (71.8m points)

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

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...