Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XSD desigener error Visual Studio 2017

I get the following error if I try to open a .xsd file or create a new one in Visual Studio 2017 its a .net 3.5 project and was working fine before I reinstalled windows and upgraded to visual studio 2017 pro.

This seems to be .net 3.5 specific as I opened another project that's 4.0 and its .xsd opened in designer fine.

To prevent possible data loss before loading the designer, the following errors must be resolved:

Value cannot be null. Parameter name: instance

 Instances of this error (1)  
  1. Hide Call Stack at System.ComponentModel.TypeDescriptor.AddAttributes(Object instance, Attribute[] attributes) at Microsoft.VisualStudio.Design.VSDesignSurface.CreateDesigner(IComponent component, Boolean rootDesigner) at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo) at System.ComponentModel.Design.DesignerHost.PerformAdd(IComponent component, String name) at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name) at System.ComponentModel.Container.Add(IComponent component) at Microsoft.VSDesigner.DataSource.Designer.DataSourceDesignerLoader.HandleLoad(IDesignerSerializationManager serializationManager) at Microsoft.VSDesigner.DesignerFramework.BaseDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager) at Microsoft.VSDesigner.DesignerFramework.BaseDesignerLoader.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

Link to error screen shot

like image 653
Cain H Avatar asked Mar 23 '17 22:03

Cain H


1 Answers

I'm observing the same symptoms you describe and, as suggested by Tibi, also found that changing the Target Framework to 4.6 (via Website→Start Options→Build for ASP.NET projects) worked for projects where that was feasible.

I found two open issues for this behavior on the Visual Studio Developer Community website:

  • #26937 - DataSet fails to open in designer
  • #54432 - Opening Dataset xsd's Throws Designer Error

Neither has a solution (other than the Target Framework 4.6 workaround) nor official feedback after more than 6 months.

like image 116
Kevinoid Avatar answered Oct 12 '22 12:10

Kevinoid