c# - System.NullReferenceException 未将对象引用设置为对象的实例

标签 c# silverlight error-handling

所以,我明白了

System.NullReferenceException
Object reference not set to an instance of an object.
   at Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.<GetXmlNamespaceCompatibilityMappings>d__8.MoveNext()
   at MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption()
   at MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(Identifier identifier)
   at MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context)
   at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider)
   at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean convertToXamlWithErrors)
   at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem()
   at Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem()
   at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState()
   at MS.Internal.Host.PersistenceSubsystem.Load()
   at MS.Internal.Host.Designer.Load()
   at MS.Internal.Designer.VSDesigner.Load()
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
   at MS.Internal.Host.Isolation.IsolatedDesigner.Load()
   at MS.Internal.Designer.DesignerPane.LoadDesignerView()

创建新的 silverlight 项目时出错。 文件 > 新建 > 项目 > Visual C# > Silverlight > Silverlight 应用程序。

  • “在新网站中托管 silverlight 应用程序”已禁用

  • Silverlight 版本:4

我的笔记本电脑上没有这个问题,它的安装与我的家用电脑完全相同。

出了什么问题?我该如何解决这个问题?

ps..此错误出现在我打开的任何 silverlight 项目中。它是否是我已经在开发的一个新的。

[更新]

但是如果我安装了silverlight 5,当我开始一个新项目时,我是否不能选择这个?我还是只能选择Silverlight 3和Silverlight 4。

此外,正如您提供的链接中所述,我的“程序和功能”中没有 siverlight 5。

但是,在谷歌上搜索如何检查 silverlight 版本..我被发送到寄存器以检查 silverlight 的版本 key 。

key 显示我的版本是:5.1.10411.0

如果我的程序和功能中没有 silverlight 5,如何删除 silverlight 5?

最佳答案

这可能是由于将 silverlight 升级到版本 5 引起的。引用自 social.msdn.microsoft.com :

It seems you upgraded your version of silverlight to Silverlight 5. if so you may need to Uninstall silverlight 5 and 4 then Install SilverLight 4 developer runtime at http://go.microsoft.com/fwlink/?LinkID=188039.

另请参阅here

关于c# - System.NullReferenceException 未将对象引用设置为对象的实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11015170/

相关文章:

c# - 未序列化的结构列表列表。 System.RuntimeType 由于其保护级别而无法访问。只能处理公共(public)类型

c# - 寻找 .NET 紧凑框架的 OAuth 1.0a 示例代码

c# - 如何将不同的值从一个堆栈复制到另一个堆栈

silverlight - 浏览器外 (oob) 应用程序的自定义安装程序。更新不起作用

silverlight - Silverlight 如何在 Web 浏览器中工作?

SQL Server错误处理,判断记录是否存在,然后执行过程

c# - 通用方法 : instantiate a generic type with an argument

silverlight - 自定义 ValidationAttribute 的 ValidationErrors 未正确显示

error-handling - 改造Rxjava错误处理程序

java - 将 Java 库添加到 Android 项目