0

My project is a resource file editor. It load an assembly in the appdomain and create all the .resources files from it. Then, it change theses .resources files into .resx files using Resgen.exe.

Once the .resx file are created, the windows form designer is called and create the forms from the .resx files. Then, the user can modify thoses form. Then, they are compiled with al.exe (assembly linker) to a dll.

In a way, it's like a custom Visual Studio designer, that can be use without having to install Visual Studio.

My problem is that when the designer try to draw a form that inherited from a 
base form that is in another project, it put all the components in the upper left
corner of the form.

/-----------------------------------------------------------------------------------------/

I'll explain with an exemple :

I have 2 projects : A and B. B has a form. A inherited the form from B for his own form. When I load the assembly of project A, the designer can't find the base form from project B and cannot create the form correctly.

A normal form is declared like this :

public class AboutForm : System.Windows.Forms.Form

The form from project A is declared like this :

public class ExtractForm : AlexandriaR2P.UI.BaseExtractForm

Where AlexandriaR2P.UI.dll is my project B

/-----------------------------------------------------------------------------------------/

/-----------------------------------------------------------------------------------------/

I'm creating resources files from an assemblies by reflection. If the assembly has no reference to another project for the forms, everything works fine.

But if my assembly depends on another assembly to create the form, it won't load correctly. All the component will be loaded in the top left corner, one over the others. (Inherited form)

In the resx file, I found this :

  <data name="&gt;&gt;m_SendControl.Type" xml:space="preserve">
      <value>AlexandriaR2P.UI.BaseSendControl, AlexandriaR2P.UI, Version=5.2.0.13, Culture=neutral, PublicKeyToken=null</value>
  </data>

Here, AlexandriaR2P.UI is my dll : AlexandriaR2P.UI.dll and I think the designer cannot load it correctly and the form is not well drawn.

I've made sure all the resources files from my dll are in the same folder and that the referenced assembly is loaded in the AppDomain, but I still got the problem.

Thanks!

There are no error returned by the designer when building the form ... It just load components at 0,0 since he doesn't find the information he needs.

Also, when I compile my resource with al.exe (AssemblyLinker), the form gets all deformed.

LolCat
  • 539
  • 1
  • 11
  • 24

0 Answers0