Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, November 11, 2019 9:19 AM
I opened an existing project in VS 2109, which was developed in VS 2015. When trying to open any data set I get the following error.
Value cannot be null. Parameter name:instance
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)
I am using Entityframework 6.1.3
Thanks,
All replies (2)
Tuesday, November 12, 2019 3:05 AM ✅Answered
Hi Ali Abdullah Nabi,
Welcome to MSDN forum.
I consider this might be caused by the incompatible of the version of .NET Framework. Not sure which version of .NET Framework do you target to, if possible you could try to change the target Framework to maybe 4.7.2 from right-click project -> Properties -> Application -> Target framework. There is a similar issue Visual Studio 2019 Dataset Designer Error: Value cannot be null. Parameter name:instance might be helpful for you to refer to.
I also tried to test and reproduce in my side. Create a new WimForm App (.NET Framework 4.7.2) in VS 2015 and add a dataset to the project, then save project and close VS 2015. Start VS 2019 and open the exist project then open data set but everything seems work without any error.
In addition, after research I find this document Visual Studio – parameter instance with value null (and other design errors) when opening XSD files which shares us with some workarounds and according to it, I notice the author both inform this issue about the version of framework. I abstract the steps that could fix this issue below and hope this could also help you.
- Open the Project (or Website) Property Page.
- Locate the section where you can choose the .NET Framework version (Start Options -> Build for most project types).
- If your project is using a .NET Framework lower than 4.7.2, set it to 4.7.2 (in case you don’t have it installed, you might have to download it and restart Visual Studio afterwards).
- If your project is using the .NET Framework 4.7.2, downgrade it to 4.6.1 (again, if you don’t have it download it and restart Visual Studio).
BTW, if you still could not fix this issue, I need more details to reproduce your issue. You could share us maybe with a simple sample by uploading it to OneDrive or Github and post the link here, I will then go to download it and test in my side. If I could reproduce your issue, I will report this issue to the Visual Studio Product Team.
Any feedback would be great expected, and we are looking forward to hearing from you.
Best Regards,
Tianyu
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].
Tuesday, November 12, 2019 3:31 AM
Hi Tianyu,
Wow, you solution solved the issue in just three clicks. Awesome !
Thank you so much.