日期:2014-05-20  浏览次数:21009 次

Silverlight打开xaml文件报错
发生了未处理异常

System.NullReferenceException
未将对象引用设置到对象的实例
  在 Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.<GetXmlNamespaceCompatibilityMappings>d__8.MoveNext()
  在 MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption()
  在 MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(Identifier identifier)
  在 MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context)
  在 MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider)
  在 MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean 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 view)
  在 MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
  在 MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
  在 MS.Internal.Host.Isolation.IsolatedDesigner.Load()
  在 MS.Internal.Designer.DesignerPane.LoadDesignerView()


重新加载了无数次设计器,无效!!


------解决方案--------------------
楼主找到方法没有?跪求
------解决方案--------------------
同样的问题。。。
------解决方案--------------------
很多时候,在它的loaded事件中应该首先写上 if (!DesignerProperties.IsInDesignTool) 判断。
------解决方案--------------------
我有一个疑问……SP1234是不是天天没事专门上CSDN搞分享或答疑的…………
------解决方案--------------------
探讨

我有一个疑问……SP1234是不是天天没事专门上CSDN搞分享或答疑的…………

------解决方案--------------------
看这个
http://www.cnblogs.com/Joetao/articles/2368510.html