Page 1 of 1

Ecxeption adding control

Posted: Thu Aug 22, 2019 10:43 pm
by Mosir Poranki
Hello gents

I am using visual studio 2013 on Windows 10. I am trying this:
- Create new project
- C#
- Windows Forms Application
- Open project properties, go to Build tab
- Changed Platform target to x64
- Tried to add the control to the form
I get this error message and nothing appears in the form:

---------------------------
Microsoft Visual Studio
---------------------------
Failed to create component 'AxHost'. The error message follows:

'System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

at System.Windows.Forms.Design.DocumentDesigner.AxToolboxItem.CreateComponentsCore(IDesignerHost host)

at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host, IDictionary defaultValues)

at System.Drawing.Design.ToolboxItem.CreateComponents(IDesignerHost host, IDictionary defaultValues)

at System.Windows.Forms.Design.OleDragDropHandler.CreateTool(ToolboxItem tool, Control parent, Int32 x, Int32 y, Int32 width, Int32 height, Boolean hasLocation, Boolean hasSize, ToolboxSnapDragDropEventArgs e)'
---------------------------
OK
---------------------------

I have 64bit v6.0 update 4989 installed

Would you have any suggestions for me?
Thank you

Re: Ecxeption adding control

Posted: Fri Aug 23, 2019 12:43 am
by Prashant Kande
Hello Mosir
There are two things:
1. Control has to be inserted before changing target platform. This is because Visual Studio itself a 32 bit app
2. Change the target platform to x64 in configuration manager instead of going to the Build properties. Build properties will be set automatically
It should work this way

Regards

Re: Ecxeption adding control

Posted: Mon Aug 26, 2019 2:24 am
by Mosir Poranki
Nice. Thank you