C# – System.NullReferenceException Object reference not set to an instance of an object

cerror handlingsilverlight

So, I get this

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()

error when I create a new silverlight project.
File > New > Prooject > Visual C# > Silverlight > Silverlight Application.

  • "Host the silverlight application in a new Web Site" is disabled

  • Silverlight version: 4

I don't have this problem on my laptop which has the complete same installation as my home pc.

What is wrong? How can I fix this?

ps.. this error shows up in ANY silverlight project I open. Whether it's a new one of the one's i've already been working on.

[Update]

But IF I have silverlight 5 installed, wouldn't I be able to choose this when I start a new project? I can still only choose Silverlight 3 and Silverlight 4.

Also, as stated in the link you gave, I have no siverlight 5 in my "Programs and Featues".

However, a search on google on how to check silverlight version.. I got send to the register to check out a Version Key of silverlight.

The key says my version is: 5.1.10411.0

If there's no silverlight 5 in my Programs and Features, how I can remove silverlight 5?

Best Answer

This is likely caused by upgrading silverlight to version 5. Quote from 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.

Also, see here