Results 1 to 3 of 3

Thread: Should I inherit forms from an outside source

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    2

    Unhappy Should I inherit forms from an outside source

    Building a Windows Application, I'm trying to create some base form, compile them into a class library, and then from that point on, for my other projects, I only what to reference the DLL (not include the class library as another project in my solution). But I keep getting build errors (below) when I try to open the inherited form in my Designer, plus I do NOT see any of the controls that I added on top of the base form - I only see the controls of the base form.

    This is in reference to the following errors:
    Method System.CodeDom.CodePropertyReferenceExpression.AddRange not found
    Method System.CodeDom.CodePropertyReferenceExpression.SuspendLayout not found
    Method System.CodeDom.CodePropertyReferenceExpression.ResumeLayout not found

    To duplicate the error:
    1. Create a base form and add some basic controls.
    2. Build as a Class Library. This creates a DLL file.
    3. Copy the DLL file to a common directory.
    4. In a new project (and a new solution) add a new Inherited Form. In the picker, click browse to find and select this DLL. Then select the base form you've just created.
    5. Everything looks find. Now add a few more basic controls on top of the base form. Save, close the form, and re-build.
    6. Now open the new form again and you'll see one or more of the build error that I've listed above. Also, the controls that you added on top of the base form are not shown.
    NOTE: if you keep the base form class library project within your solution, with the inherited form project, then there is no problem.

    Any ideas or is this a MS VS.NET bug?


    Thanks much,

  2. #2
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    Have you added a "reference" to the class library DLL?

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    2
    Yes, I have added the reference. If you'll note in step #4 of the "how to re-create," when you add a new form, choose the Inherited Form template, then the Inheritance Picker Dialog Box pops up. Here is where I click Browse to find my DLL. Once selected, the base forms are listed in the Inheritance Picker Dialog Box and I can choose which one I want to inherit. Once choosed, the inherited form is created and a reference to the DLL is automatically place into your Reference List in the Project Explore.

    I've also tried adding the DLL to the Reference List manually and then opening my Inherited Form. Same problem.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width