Search code examples
silverlightvisual-studio-2010xamldesigner

System.ArgumentNullException when creating a new Silverlight Project


I'm getting the exception listed below when looking at the MainPage.xaml of a newly created Silverlight application. By newly created I mean nothing, at all, has been modified; I just create the solution in VS and get the error as soon as it loads the xaml in the designer.

  • I'm using Visual Studio 2010 Professional on Windows XP.
  • Building the entire solution succeeds and appears to run without error. I say "appears" though because it's a blank screen; no controls have been added.
  • I've recreated the solution multiple times, restarted VS, rebooted, etc.
  • I've tried running the repair/reinstall twice.
  • I've applied all updates available via Windows Update.
  • I've tried creating both Silverlight 3 and 4 solutions.
  • I've searched the Internet to no avail.

What's wrong?

System.ArgumentNullException
Value cannot be null.
Parameter name: parentContext
   at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext..ctor(IMetadataContext parentContext)
   at MS.Internal.Host.ProjectMetadataContext..ctor(IMetadataContext platformMetadata, AssemblyReferenceProvider referenceProvider)
   at MS.Internal.Host.ProjectMetadataContext.FromReferences(AssemblyReferenceProvider referenceProvider)
   at MS.Internal.Designer.VSDesigner.GetMetadataForDesignerContext(DesignerContext designerContext)
   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()

Solution

  • Ended up having to reinstall Windows, unfortunate, but it works now.