AddInModule Designer not displayed in Visual Studio 2017 due to null value for parameter instance

Add-in Express™ Support Service
That's what is more important than anything else

AddInModule Designer not displayed in Visual Studio 2017 due to null value for parameter instance
 
David R.




Posts: 55
Joined: 2010-07-22
Using Visual Studio 2017 v15.9.29 running as administrator, and the latest Add-in Express v904-b4644 Standard, I created a new project of type ADX COM Add-in for Office 2010+ compatibility, for Excel only. When I double click the AddinModule.cs which should open the designer, Visual Studio displays the following message:

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)
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.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

I searched the forum and found this article from 11 years ago: https://www.add-in-express.com/forum/read.php?FID=5&TID=4747

Windows already had Add-In Express v904-b4644 installed, but I uninstalled it, and installed it again, and created a new project but the same problem occurs.

Using Google I see this error is generic and occurs with other components such as Telerik, DevXpress, etc. Some of the suggestions are to use a different .NET Framework which I have tried but with no success. I have also set the project build platform to x86, and the target to x86, but that didn't help either.

What am I doing wrong?
Posted 12 Nov, 2020 14:30:23 Top
Andrei Smolin


Add-in Express team


Posts: 17502
Joined: 2006-05-11
Hello David,

I've updated my VS 2017 to 15.9.29, created a new project and found that the project wizard opens the designer of the add-in module when the project is created so that you wouldn't need to double-click AddinModule.cs.

You don't describe anything that might sound like "wrong". Please create a new add-in project and send the complete project folder to the support email address; find it in {Add-in Express installation folder}\readme.txt; make sure your email contains a link to this topic.

Also, choose Help | About in the main menu of the Visual Studio IDE, and click Copy Info on the About dialog. This puts the info the dialog displays to the clipboard, please send me that info. My VS 2017 shows .NET Framework 4.8.04084 on the About dialog.

Something related to using one of the Visual Studio extensions that you have?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Nov, 2020 01:15:29 Top
David R.




Posts: 55
Joined: 2010-07-22
I have emailed the requested VS project, and VS information to you.
Posted 13 Nov, 2020 09:09:46 Top
Andrei Smolin


Add-in Express team


Posts: 17502
Joined: 2006-05-11
Thank you!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Nov, 2020 09:43:27 Top
Andrei Smolin


Add-in Express team


Posts: 17502
Joined: 2006-05-11
Hello David,

There's nothing suspicious in the project.

In the IDE, open Tools | Options | Windows Forms Designer and set Optimized Code Generation = False.

If this doesn't help, try to disable the Visual Studio Extensions named Sharp*.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Nov, 2020 11:08:37 Top
David R.




Posts: 55
Joined: 2010-07-22
Setting Optimized Code Generation to false didn't correct the problem.

There are no extensions named Sharp*. This link shows the installed extensions.

https://imgur.com/CRyVIdq
Posted 13 Nov, 2020 12:02:07 Top
Andrei Smolin


Add-in Express team


Posts: 17502
Joined: 2006-05-11
I see. I've misinterpreted the text you sent us.

Try to disable AnkhSVN.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Nov, 2020 12:39:05 Top
David R.




Posts: 55
Joined: 2010-07-22
I disabled AnkvSVN but it didn't make a difference. I created a new project in the same way that I explained in the email to support, but the designer still won't open. There must be a problem with VS 2017. I have VS 2019 installed on the same computer so I will try it.
Posted 13 Nov, 2020 12:47:55 Top
David R.




Posts: 55
Joined: 2010-07-22
So I uninstalled Add-in Express, and installed it again with a binding to VS 2019, and created a project in VS 2019, and the Designer displays correctly. I guess the VS 2017 installation is corrupt. This can be closed.
Posted 13 Nov, 2020 12:56:21 Top