If you have ever received this error before, it is most likely due to you trying to insert/update a table where a field is required and you are not passing the required field any value.
Unfortunately, when you log this error, it does not specify the offending fields, nor is it mentioned in any way in the genera exception message. This is a known issues and it appears Microsoft has no plans to ever make it easier to see the offending entities, etc.
So, I use this temporary catch statement (dev purposes only) to identify what is going wrong. I use log4net, but you could write this out the console if needed, or use another logger, or just do debug print.
catch (DbEntityValidationException dve)
foreach (var eve in dve.EntityValidationErrors)
foreach (var ev in eve.ValidationErrors)
MyLogger.Info(ev.ErrorMessage + " " + ev.PropertyName);
Note: This type of error is rare and usually occurs when a mistake has been made at the table level for the required fields, or when someone else on the team has changed the column definitions on a table, and those changes conflict with the existing code base.
This is a small list of utilities/software that I use on a regular basis where I work. Without them, my job would be a lot harder.
Beyond Compare[^] - for performing file and folder comparisons. Very powerful.
Renamer[^] - A very efficient file renamer. Customized rules and settings. FREE
Snag It[^] - we all know about this little gem. Excellent screenshot software and editor. Great for documentation writers.
Komodo Edit[^] - I do a lot of Perl programming from time to time and this is one of the best Perl editors on the market. The Edit is FREE (no debugging integration in the IDE) but everything else is awesome.
Ultra Edit[^] - again, we all know about this one but I still have to say it is the best general purpose editor around IMHO.
RegEx Buddy 3[^] - A must have tool for anyone working with regex. It works with a variety of languages: .Net and Perl being important to me.
Good collection. Its a need of software develeoper. Have my 5.
I used windiff instead of Beyond Compare as I dont have any idea about it. I will download it and check it.
Thanks for such a nice collection.
I believe in LOVE AT FIRST SIGHT...
Bcoz I have loved my Mother...
even since I opened my eyes...(ICAN)