0

今天我遇到了一件奇怪的事情。昨天我所有的代码都运行良好,我在关闭电脑之前测试了两次。今天,当我尝试打开我的项目时,异常到达“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()

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

4

1 回答 1

0

在尝试了 3-4 小时后,我选择了简单的方法,它有效!这是我所做的:

  1. 转到添加/删除程序并卸载所有 silverlight 应用程序,所有这些。
  2. Rebbot 我的电脑,安装 SL4 工具、SL4 Toolkit 和 SL4 Developer 运行时。
  3. 确保更改 SL4 的选项以自动更新其版本。
  4. 再次重启,它就完成了

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

于 2013-11-21T05:17:51.530 回答