0

我的項目包含350個表單,78萬行代碼(350萬設計器代碼)。Visual Studio 2010/2008「單擊設計表單後,出現'System.OutofMemoryEception'類型的異常拋出'錯誤

但是當我想要設計窗體時,每兩三個設計VS就會給出「類型異常」System.OutofMemoryEception「被拋出」的錯誤。

我重新啓動該項目,該錯誤消失,直到重建或打開幾個形式......我不能」工作在5分鐘...

我在看內存使用情況:devenv.exe的使用500/600 MB和我的系統使用1.9 GB RAM 4GB RAM 我不這麼認爲,但是VS崩潰或不支持項目中的350個表單?

有沒有VS存儲器選項的解決方案?

這是截圖: http://social.microsoft.com/Forums/getfile/22517/

我的系統spesifics是;

Intel Core i5 CPU 
4 GB RAM 
Operation system :Windows XP 32 bit (at the windows 7 problem is same) 
Visual Studio 2010 Ultimate (at Visual Studio 2008 Professional SP1 problem is the same) 

調用堆棧

at System.Reflection.AssemblyName.nGetFileInformation(String s) 
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile) 
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_AssemblyName() 
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly() 
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description) 
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly) 
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreCase, Assembly& assembly, ReferenceType refType) 
at Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType) 
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase) 
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name) 
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.GetType(String typeName) 
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.GetType(String typeName) 
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression) 
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression) 
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError) 
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement) 
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement) 
+0

你有沒有分析你的程序,看看它在運行時消耗多少內存? –

+0

350表格可以做什麼,10不能? –

+0

感謝您的興趣, 克里斯,我有32位操作系統。我編輯了我的第一篇文章來獲取這些信息 我已經有了另一個類庫(用於函數,db連接等) Anders,no 但是我在系統中有很多內存,而VS崩潰了...... – Pisagor

回答

0

您是否正在運行32位或64位XP你不說。我會冒險猜測你正在運行32,剛剛達到你的PC的極限。在大多數系統上你只能獲得大約2GB的虛擬內存。

無論哪種方式,我會認真考慮重組您的項目,因爲350 WinForms對我來說似乎相當過分。必須有某種方式可以減少這種情況,以避免重複或創建可將某些功能卸載到的類庫項目。

你可以給Solution Load Manager嘗試將項目和文件標記爲按需加載而不是啓動。

相關問題