When calling SaveChanges on an entity context object you can sometimes get a DbEntityValidationException error but it doesn't give you a convenient message as to what the error(s) were. Here is a code snippet to get a convenient message from the DbEntityValidationException object:

Had a website with a master page and in the the page_load event I was calling Page.ClientScript.RegisterStartupScript to run some javascript based on the current state of the application. In the default.aspx page the script worked fine but in this other page the script was not getting called at all.

After much research I have learned that Page.ClientScript.RegisterStartupScript only works if the page has a form element that has the runat="server" set. Once I added a form element with runat="server" to the other page the script finally started getting called the same as it did on the default.aspx page which of course had already had a form element.

If your System.Diagnostic trace is not creating a file in asp.net make sure the the user that the website/webapp is running under has write permissions to the log file folder(default is web root ie where the web.config is).

You can find the user that the website/webapp is running under by going into IIS. Go to the application pool that the website/webapp is running under and the Identity column will show the user that needs write permissions to the log file folder.

DimxmlAsXDocument=MyXmlDimactual()AsByteDimproxyAs MyWebService.MyServiceClient=NothingTryproxy=New MyWebService.MyServiceClientactual=proxy.GenerateForm(xml.Root)proxy.Close()CatchexAsTimeoutExceptionproxy.Abort()Throwex'Or do what everCatchexAsCommunicationExceptionproxy.Abort()ThrowexCatchexAsExceptionproxy.Abort()ThrowexEndTry

I got the real error message which was that in the config binding maxBufferSize cannot be a different value from maxReceivedMessageSize.