打开Silverlight 4项目时xaml出现异常



今天我遇到了一件奇怪的事情。昨天我所有的代码都很好,我在关闭电脑之前测试了两次。今天,当我试图打开我的项目时,异常出现了"System.NullReferenceException对象引用未设置为对象的实例。"我搜索了解决方案,但没有一个对我有效。我没有升级silverlight版本,我用silverlight 4开始了我的工作,很明显我使用的是相同的。以下是异常的堆栈跟踪:

System.NullReferenceException对象引用未设置为对象的实例。位于Microsoft.Windows.Design.Platform.SilverlightMetadataContext.Silverlight XamlExtensionImplementations.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父级、PrefixScope父级Scope、IParseContext上下文、IMarkupSourceProvider提供程序)位于MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(布尔转换为XamlWithErrors)位于MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem()位于Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiebleRootItem()位于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.VSIolatedDesigner.VSIsolatedView.Load()位于MS.Internal.Designer.VSIolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView视图)位于MS.Internal.Host.IIsolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory工厂,IsolatedView视图)位于MS.Internal.Host.IIsolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory工厂,IsolatedView视图)位于MS.Internal.Host.Iisolation.IisolatedDesigner.Load()

希望你的建议能解决我的问题。

在尝试了3-4个小时后,我进行了简单的尝试,它成功了!以下是我所做的:

  1. 转到添加/删除程序并卸载所有silverlight应用程序
  2. 重新启动我的电脑,安装SL4工具,SL4工具包和SL4开发人员运行时
  3. 请确保更改SL4的选项以自动更新其版本
  4. 又一次重新启动,它完成了

我怀疑,由于我没有更改默认设置,所以SL4在没有通知我的情况下将自己更新为SL5:)请确保禁用自动更新。

最新更新