On my development machine everything is working fine, however as soon as I publish it to the server I get
System.InvalidCastException: Specified cast is not valid
This is happening on
db.SubmitChanges();
I’ve check out https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=351358 and it still causes me errors
I also ran the Windows Update and everything is up to date on the server
Okay I have resolved the issue.
What appears to be the problem is that I have tables that have Id as Int and the Primary keys and also have GUID’s as a fields which is defined as Unique, and the Guid field is a key to another table and being used as a foreign key.
When I set the Guid field as the primary key in the table the problem goes away.
I’ve not created a test project to prove this, due to time constraints as we are going live next week