问题
I have an existing project they I have been using for quite some time. I made some changes in the SQL database and updated the model from the database. When I tried to save the model Visual Studio crashed with the infamous "Restarting error" I checked the event log and it has the following error:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at EnvDTE.ProjectItem.get_FileNames(Int16)
at Microsoft.VisualStudio.TextTemplating757345F6D4CE4C06DC5EF6A7E4BE0C5A.GeneratedTextTransformation+EntityFrameworkTemplateFileManager+VsEntityFrameworkTemplateFileManager.ProjectSync(EnvDTE.ProjectItem, System.Collections.Generic.IEnumerable1<System.String>)
at Microsoft.VisualStudio.TextTemplating757345F6D4CE4C06DC5EF6A7E4BE0C5A.GeneratedTextTransformation+EntityFrameworkTemplateFileManager+VsEntityFrameworkTemplateFileManager._Lambda$__19(System.Collections.Generic.IEnumerable
1)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr, System.Object[], System.Object, Int32, Boolean, System.Object[] ByRef)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessageSink)
at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.DoAsyncCall()
at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.runTryCode(System.Object)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
When I turned off the "transform related text on save" option i was able to save the model. However If I run the custom tool on the tt file the error reoccurs. Obviously the error is happening during the code generation. What would cause this to suddenly happen ? I thought I may have a corrupt edmx file, so I extracted the last saved version form TFS and it works fine. Any help would be appreciated since I'm currently stuck and unable to update the model.
来源:https://stackoverflow.com/questions/14820874/visual-studio-2010-crash-generating-transforming-text-templates-for-entity-frame