Always see NullReference exception in designer with all silverlight business applications in visual studio 2010

我与影子孤独终老i 提交于 2019-12-05 16:31:40

问题


Starting with the most simple case.

If I press "File->new project->silverlight business application" it opens up to MainPage.xaml saying the message attached at the bottom of this post.

It also does the same thing to any silverlight business application that exists in sourcesafe - this is the first time I've personally needed to work on this technology.

Any advice would be very much appreciated I really need to get started on a project and I feel quite disabled to not have the designer.

Thanks in advance.

An Unhandled Exception has occured

Click here to reload the designer

Details:

System.NullReferenceException Object reference not set to an instance of an object. at Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementations.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()


回答1:


If you run into this issue, a possible cause is due to you having Microsoft SilverLight version 5.0 installed on your pc versus that of 4.0 (Version: 4.0.50826.0). Remove the copy of SilverLight 5.0. Install the version located at the following link - http://go.microsoft.com/fwlink/?LinkId=146060 DO NOT INSTALL version 5.0 IF YOU HAVE SDK 3 AND 4. INSTALL MICROSOFT SILVERLIGHT 4.0




回答2:


This happens if you have installed visual studio 2011 developer preview on your pc.

To resolve the error close visual studio and your browsers. Uninstall silverlight (no need to uninstall the sdk just silverlight itself).

Then re-open your project. Follow the instructions and it'll be working just fine.




回答3:


it might be because of your application is developed on Silverlight 5 and you are opening it with the machine having silverlight 4. i am just giving example of 5 and 4. or might be you have not installed the SDK pack of it.



来源:https://stackoverflow.com/questions/8180828/always-see-nullreference-exception-in-designer-with-all-silverlight-business-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!