We're working with EF 6 (I think it's EF 6.1.3, but not sure), in a WPF app using .NET Framework 4.5.2. We use .EDMX files for specifying our EF models.
Yesterday we added three new tables to the database, so I got into the EDMX file designer, to try to add those new tables. That failed, miserably. For whatever reason EF was removing other tables to put those new tables into the EDMX.
After trying for several hours to add those three tables I decided to just rebuild the .EDMX file from scratch, so I emptied everything out of it, then put them all back in again. That has helped. Instead of getting almost 200 EF related error messages, I'm now down to just one EF related error message. But it's one I've never seen before. Since I'm using the EF EDMX designer, I've not written any code to cause this error. And I've no idea how to resolve it. Here's the complete text of the error:
Error An Exception was thrown while processing the template. The following Exception was thrown:
System.AppDomainUnloadedException: The application domain in which the thread was running has been unloaded.
Server stack trace:
at System.Threading.Thread.InternalCrossContextCallback(Context ctx, IntPtr ctxID, Int32 appDomainID, InternalCrossContextDelegate ftnToCall, Object[] args)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.VisualStudio.TextTemplating.IDebugTransformationRun.PerformTransformation()
at Microsoft.VisualStudio.TextTemplating.Engine.ProcessTemplateImplementation(TemplateProcessingSession session, String content, ITextTemplatingEngineHost host, String className, String classNamespace, ITelemetryScope scope)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) CoreFramework C:\Src\NMBAD\NMBAD\CoreFramework\Model\AppModel.tt 0