我們有一個.NET 4,WPF,WCF,EF 4,SQL 2008應用程序。我們的EF模型之一是高度相關的,在我描述的情況下可能並可能包含循環。我被要求在現場處理一個案例,來自STE EF模型的突然數據在WPF客戶端中退出。仔細檢查後,我發現嘗試檢索(序列化)STE EF對象圖時,IIS W3WP進程崩潰。我使用調試診斷來捕獲崩潰。StackOverflowException序列化STE EF對象圖
當我看着生成的崩潰報告,我發現它是一個堆棧溢出異常(如何適當)。在事故報告中的堆棧跟蹤是相當大的,但堆棧的頂部看起來像:
System.Xml.XmlBaseWriter.StartElement(System.String ByRef, System.String, System.String, System.Xml.XmlDictionaryString)
System.Xml.XmlBaseWriter.WriteStartElement(System.String, System.Xml.XmlDictionaryString, System.Xml.XmlDictionaryString)
System.Runtime.Serialization.XmlWriterDelegator.WriteStartElement(System.String, System.Xml.XmlDictionaryString, System.Xml.XmlDictionaryString)
DynamicClass.WriteXXXDataToXml(System.Runtime.Serialization.XmlWriterDelegator, System.Object, System.Runtime.Serialization.XmlObjectSerializerWriteContext, System.Runtime.Serialization.ClassDataContract)
System.Runtime.Serialization.ClassDataContract.WriteXmlValue(System.Runtime.Serialization.XmlWriterDelegator, System.Object, System.Runtime.Serialization.XmlObjectSerializerWriteContext)
System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType(System.Runtime.Serialization.DataContract, System.Runtime.Serialization.XmlWriterDelegator, System.Object, System.RuntimeTypeHandle)
System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(System.Runtime.Serialization.XmlWriterDelegator, System.Object, Boolean, Boolean, Int32, System.RuntimeTypeHandle)
System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(System.Runtime.Serialization.XmlWriterDelegator, System.Object, Boolean, Boolean, Int32, System.RuntimeTypeHandle)
是什麼讓特別奇怪的是,當WCF服務在Visual Studio託管,我從開發環境中運行,序列化完美地工作,並且我在客戶端上獲取數據。
這可以通過IIS設置來解決嗎?爲什麼它可以與Visual Studio的開發者IIS協同工作,但不能與生產IIS協同工作?
我不確定是什麼原因導致了這個問題,或者爲什麼串行器甚至是barfing?
我應該嘗試WCF系列化與STE EF4的另一種方法?
任何輸入表示讚賞。
謝謝!
太棒了!感謝您的意見。我保證這是沿着這條線。有關如何更新IIS中堆棧大小的任何想法?本文http://blogs.msdn.com/b/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx描述瞭如何使用editbin.exe來完成。但是我們在生產環境中沒有這個exe。我可以在我的機器上更新w3wp.exe應用程序,但是我不能只在客戶機器上替換該文件,除非我擁有TrustedInstaller權限。有任何想法嗎? –