gpt4 book ai didi

wpf - 在Visual Studio 2010中调试和修复ObjectDisposedException

转载 作者:行者123 更新时间:2023-12-03 15:03:02 25 4
gpt4 key购买 nike

编辑XAML文件时,我注意到以下错误:

System.ObjectDisposedException occurred
Message=Cannot access a disposed object.
Object name: 'FileCodeModel'.


为了进行调试,我运行了Visual Studios的另一个实例,并在显示异常的Visual Studio实例中运行“调试->附加到进程”。

我能够在附加到流程的新实例中捕获异常。我发现以下异常:

System.ObjectDisposedException occurred
Message=Cannot access a disposed object.
Object name: 'FileCodeModel'.
Source=Microsoft.VisualStudio.CSharp.Services.Language
ObjectName=FileCodeModel
StackTrace:
at Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CFileCodeModel.GetCompilation(Boolean fBlockForParses)
at Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CPartialTypeCollection.EnumerateParts()
at Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CPartialTypeCollection.get_Count()
at Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CSlowSnapshot..ctor(CodeElements collection)
at Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CPartialTypeCollection.CreateSnapshot()
at Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CCollectionBase.GetEnumerator()
at EnvDTE.CodeElements.GetEnumerator()
at MS.Internal.VSSymbols.SymbolProvider.GetProperties(String fullName, Boolean isTypeDefinition, Boolean useCodeModel)
at Microsoft.Xaml.Symbols.IXamlSymbols.GetProperties(String typeName, Boolean isTypeDefinition, Boolean useCodeModel)
at MS.Internal.Design.Markup.HostedType.BuildProperties(Boolean useCodeModel)
InnerException:


任何人都曾在您的XAML中遇到此异常,以及您如何解决该异常。

最佳答案

您正在运行XAML美化器吗? -我有类似的扩展程序可以清理XAML。

关于wpf - 在Visual Studio 2010中调试和修复ObjectDisposedException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9315356/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com