固定的ObjectDisposedException当编辑XAML文件,我注意到以下错误:调试和Visual Studio 2010中
System.ObjectDisposedException occurred
Message=Cannot access a disposed object.
Object name: 'FileCodeModel'.
要调试这个我跑视觉工作室的另一个实例,“调试 - >附加到进程”的显示异常的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中,和你是做什么来解决它。
澄清,这是Visual Studio中的错误,而不是代码中的错误? – mydogisbox 2012-02-20 16:29:20
您是否能够在发生这种情况时提供XAML? – Phil 2012-02-20 16:45:46
对..它发生在VS2010中。这会导致XAML文件编辑速度变慢,并且VS有时无法响应。双击例外只会导致文件的顶部,没有别的。 – jmogera 2012-02-20 16:47:09