walkinside / sdk

Develop powerful desktop and web applications on top of Walkinside 3D engine
4 stars 4 forks source link

How to enable designing the windows form #57

Closed almajidi closed 5 years ago

almajidi commented 5 years ago

I try to open the MainForm.cs[Design] but was getting error message as below,

The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: MainForm --- The base class 'vrcontext.walkinside.sdk.VRForm' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.

Is there any ways to solve this?

griemens commented 5 years ago

This happens when you reference the 64bits versions WalkinsideSDK2.dll and WeifenLuo.WinFormsUI.Docking.dll. Visual studio designer is running in 32bits and can not load the 64bits versions to be used in the designer.

There are 2 ways to solve this.

  1. Open MainForm.cs (source code) and replace "Class MainForm: VRForm" by "Class MainForm: Form". Now open the form in the designer (without compiling). In the designer you do your modifications and save. Before compiling undo the change by renaming Form back to VRForm.
  2. Reference the 32Bits versions of the Walkinside DLLs instead of the 64Bits versions. Now in the properties of the references set "Copy Local" to False. Debugging with 64bits will still work.

Kind regards

almajidi commented 5 years ago

It works! thank you so much @griemens :)