问题 在visual studio 2010中的所有silverlight业务应用程序中,始终会在设计器中看到NullReference异常


从最简单的案例开始。

如果我按下“文件 - >新项目 - > silverlight业务应用程序”,它将打开MainPage.xaml,并在此帖子的底部附上消息。

对于sourcesafe中存在的任何silverlight业务应用程序,它也会做同样的事情 - 这是我个人第一次需要使用这项技术。

任何建议都非常感谢我真的需要开始一个项目,我觉得很残疾,没有设计师。

提前致谢。

发生了未处理的异常

单击此处重新加载设计器

细节:

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 context)at   MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent,   PrefixScope parentScope,IParseContext上下文,IMarkupSourceProvider   提供者)   MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(布尔   convertToXamlWithErrors)at   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()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   查看)   MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory   工厂,IsolatedView视图)   MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory   工厂,IsolatedView视图)   MS.Internal.Host.Isolation.IsolatedDesigner.Load()at   MS.Internal.Designer.DesignerPane.LoadDesignerView()


11274
2017-11-18 10:17


起源



答案:


如果您遇到此问题,可能的原因是您的PC上安装了Microsoft SilverLight 5.0版而不是4.0版(版本:4.0.50826.0)。删除SilverLight 5.0的副本。安装位于以下链接的版本 - http://go.microsoft.com/fwlink/?LinkId=146060 如果您有SDK 3和4,请不要安装5.0版本。安装MICROSOFT SILVERLIGHT 4.0


10
2018-01-18 19:15



一个经历过痛苦的男人的话​​! :) - Paul Hutchinson
该链接指向Silverlight 5的下载...但修复+1。 - Erix
非常感谢,我从最近3个小时开始苦苦挣扎,现在工作正常:) - Avinash Singh


答案:


如果您遇到此问题,可能的原因是您的PC上安装了Microsoft SilverLight 5.0版而不是4.0版(版本:4.0.50826.0)。删除SilverLight 5.0的副本。安装位于以下链接的版本 - http://go.microsoft.com/fwlink/?LinkId=146060 如果您有SDK 3和4,请不要安装5.0版本。安装MICROSOFT SILVERLIGHT 4.0


10
2018-01-18 19:15



一个经历过痛苦的男人的话​​! :) - Paul Hutchinson
该链接指向Silverlight 5的下载...但修复+1。 - Erix
非常感谢,我从最近3个小时开始苦苦挣扎,现在工作正常:) - Avinash Singh


如果您已在PC上安装了visual studio 2011开发人员预览版,则会发生这种情况。

要解决错误,请关闭visual studio和您的浏览器。卸载silverlight(无需卸载sdk只需Silverlight本身)。

然后重新打开你的项目。按照说明操作,它会正常工作。


4
2017-11-18 10:37



非常感谢,我从最近3个小时开始苦苦挣扎,我已经卸载Silverlight并安装了Silverlight 4,现在它的工作正常:) - Avinash Singh


这可能是因为您的应用程序是在Silverlight 5上开发的,而您正在使用具有silverlight 4的计算机打开它。我只是举例说明了5和4.或者您可能没有安装它的SDK包。


-1
2017-09-14 07:38