开发者

Validation failed in Entity Framework, ASP.NET MVC3

开发者 https://www.devze.com 2023-04-06 10:36 出处:网络
My application using ASP.NET MVC3 with EF4.1, deployed on IIS7. Recently I\'ve meet an error when trying to save an entity to an existing database on the production server, but everything goes well on

My application using ASP.NET MVC3 with EF4.1, deployed on IIS7. Recently I've meet an error when trying to save an entity to an existing database on the production server, but everything goes well on my development machine.

I tried to build deploy package in VS2010 and import that package in IIS7, also, I've tried to upload all the solutions and create an application in IIS7 manually, but both of the 2 sites come to an error when executing a function that saves an entity to the database.

Error message is pasted below, but the physical path in error message does not exist in the production server, it's a path in my local development machine. This makes me confused. Has anybody ever seen this before?

BTW, I've fully backed up my database and restored it on the production server, so all the databases are same.

I'm open to hear any advice.

Thanks

Cheng

Error message:

Server Error in '/xxxx' Application. Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.

Source开发者_StackOverflow中文版 Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.]

System.Data.Entity.DbContext.SaveChanges() +212 xxxxx.Models.SetupRepository.CreateApplicationOption(Guid companyId) in D:\xxxx\Models\SetupRepository.cs:59 xxxxx.MvcApplication.MvcApplication_PostAcquireRequestState(Object sender, EventArgs e) > in D:\xxxx\Global.asax.cs:87 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号