views:

272

answers:

1

I have a follow-up question to this one.

I created a new form, inherited from an existing form, and in the designer I only see: "Visual Inheritance is currently disabled because the base class references a device-specific component or contains P/Invoke".

Neither is the case. The base form contains a PictureBox and 2 labels, and even if I delete everything from the base, the designer will still not show the inherited form.

This thread seems to suggest a workaround for this error, by creating a design-time attribute file (.xmta) and setting the DesktopCompatible attribute for the base form. When I do this, the project no longer builds, and I get this error:

Error   2 genasm.exe(1) : error There was an error initializing.
Invalid assembly public key. (Exception from HRESULT: 0x8013141E)

Unfortunately, the design view still does not work and shows the same message as before.

I tried to find an explanation for this error message, but got nowhere. Any help is appreciated.

A: 

After a few failed attempts and several discussions with Forms experts, I have determined the Forms inheritance is not a good approach, not for this problem and most others. I think that MusiGenesis's answer to the original question was not good advice. The primary reason is that there is a long string of issues with the Designer and inheritance documented all over the web. I was not able to resolve these issues. Instead, I used simple docking and, while it is not perfect, renders all forms fine and the app is usable on any screen resolution that is out there.

cdonner