今天我遇到了一件奇怪的事情。昨天我所有的代码都运行良好,我在关闭电脑之前测试了两次。今天,当我尝试打开我的项目时,异常到达“System.NullReferenceException 对象引用未设置为对象的实例。” 我搜索了解决方案,但没有一个对我有用。我没有升级 silverlight 版本,我从 silverlight 4 开始工作,目前我正在使用相同的版本。这是异常的堆栈跟踪:
System.NullReferenceException 你调用的对象是空的。 在 Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.d__8.MoveNext() 在 MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption() 在 MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(标识符标识符) 在 MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope,IParseContext 上下文) 在 MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent,PrefixScope parentScope,IParseContext 上下文,IMarkupSourceProvider 提供程序) 在 MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(布尔 convertToXamlWithErrors) 在 MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem() 在 Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem() 在 Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState() 在 MS.Internal.Host.PersistenceSubsystem.Load() 在 MS.Internal.Host.Designer.Load() 在 MS.Internal.Designer.VSDesigner.Load() 在 MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load() 在 MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView 视图) 在 MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory 工厂,IsolatedView 视图) 在 MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory 工厂,IsolatedView 视图) 在 MS.Internal.Host.Isolation.IsolatedDesigner.Load()
希望你的建议能解决我的问题。