Results 1 to 4 of 4

Thread: using a class from one project in another [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    using a class from one project in another [RESOLVED]

    In a solution with multiple projects, how do you reference a class from one to another? I tried adding a reference to the solution itself but that didn't work.

    I'm sure it can be done by compiling classes into a .dll but that's not an option right now for me.
    Last edited by Andy; Aug 13th, 2004 at 12:05 PM.

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    Add the class file - classname.vb - to the project.
    I'm told you don't need to then use Imports classname in the file you want to use it in if it's in the same namespace, but that doesn't work for me. Maybe the class is in another namespace from the original project, but I don't know how to change the one classfile to a new namespace, or maybe it's a VS 2002 issue. Imports works, though.

  3. #3
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    If I plan to use a class in more than one program I always compile the class into a DLL class lib (either a new one or an already existing library)

    Then all you have to do is add a reference to that DLL in any new programs that use that class.
    I don't live here any more.

  4. #4
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Yep, it's the ONLY way for doing it. Or just copy past but that doesn't seem to my like a viable option. . .
    \m/\m/

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