referencing project class within Solution

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave

    #1

    referencing project class within Solution

    I have a Solution with two projects. I am trying to
    reference a class in project2 from project1. When I
    right click on the project1 references (in Solutions
    explorer)and attempt to add a reference, I get the add
    reference window, I click on Project tab and browse to my
    solution/project folder and then to the project2.exe.
    However, I recieve an error ... seems like it is looking
    for a file with a dll extenstion. I'm a rookie at
    this ... but it seems so simple. Can anyone tell me how
    to reference a class within a project in the same
    solution? Appreciate any ideas .... Thanks!
  • Jip from Paris

    #2
    Re: referencing project class within Solution

    This is normal behavior. You can only reference DLL's because setting up a
    reference calls for loading the referenced item in the referrer process at
    runtime. The windows loader doesn't know how to load several EXE's in a
    single process.

    Now the interesting question is why do you try to reference project2 from
    project1. What kind of benefit do you expect for project1 ?

    "Dave" <davej@ccrtc.co m> wrote in message
    news:03ff01c36b 47$9520f140$a40 1280a@phx.gbl.. .[color=blue]
    > I have a Solution with two projects. I am trying to
    > reference a class in project2 from project1. When I
    > right click on the project1 references (in Solutions
    > explorer)and attempt to add a reference, I get the add
    > reference window, I click on Project tab and browse to my
    > solution/project folder and then to the project2.exe.
    > However, I recieve an error ... seems like it is looking
    > for a file with a dll extenstion. I'm a rookie at
    > this ... but it seems so simple. Can anyone tell me how
    > to reference a class within a project in the same
    > solution? Appreciate any ideas .... Thanks![/color]


    Comment

    • Dave

      #3
      Re: referencing project class within Solution

      okay ... so how do I refer to a class in another project
      within the same solution? ... remember I'm a rookie.
      [color=blue]
      >-----Original Message-----
      >This is normal behavior. You can only reference DLL's[/color]
      because setting up a[color=blue]
      >reference calls for loading the referenced item in the[/color]
      referrer process at[color=blue]
      >runtime. The windows loader doesn't know how to load[/color]
      several EXE's in a[color=blue]
      >single process.
      >
      >Now the interesting question is why do you try to[/color]
      reference project2 from[color=blue]
      >project1. What kind of benefit do you expect for[/color]
      project1 ?[color=blue]
      >
      >"Dave" <davej@ccrtc.co m> wrote in message
      >news:03ff01c36 b47$9520f140$a4 01280a@phx.gbl. ..[color=green]
      >> I have a Solution with two projects. I am trying to
      >> reference a class in project2 from project1. When I
      >> right click on the project1 references (in Solutions
      >> explorer)and attempt to add a reference, I get the add
      >> reference window, I click on Project tab and browse to[/color][/color]
      my[color=blue][color=green]
      >> solution/project folder and then to the project2.exe.
      >> However, I recieve an error ... seems like it is[/color][/color]
      looking[color=blue][color=green]
      >> for a file with a dll extenstion. I'm a rookie at
      >> this ... but it seems so simple. Can anyone tell me[/color][/color]
      how[color=blue][color=green]
      >> to reference a class within a project in the same
      >> solution? Appreciate any ideas .... Thanks![/color]
      >
      >
      >.
      >[/color]

      Comment

      • Dave

        #4
        Re: referencing project class within Solution

        I am building a series of database maintenance forms that
        are built as seperate projects. These forms use a common
        arraylist class that is used for listboxes and combo
        boxes. Only want to have to maintain this arraylist code
        in one module ... make sense? Or is my approach wrong?
        Appreciate your help/ideas.
        (I thought of having one big project... but since two of
        us are working on this, it seemed like it would be a
        control problem)
        [color=blue]
        >-----Original Message-----
        >okay ... so how do I refer to a class in another project
        >within the same solution? ... remember I'm a rookie.
        >[color=green]
        >>-----Original Message-----
        >>This is normal behavior. You can only reference DLL's[/color]
        >because setting up a[color=green]
        >>reference calls for loading the referenced item in the[/color]
        >referrer process at[color=green]
        >>runtime. The windows loader doesn't know how to load[/color]
        >several EXE's in a[color=green]
        >>single process.
        >>
        >>Now the interesting question is why do you try to[/color]
        >reference project2 from[color=green]
        >>project1. What kind of benefit do you expect for[/color]
        >project1 ?[color=green]
        >>
        >>"Dave" <davej@ccrtc.co m> wrote in message
        >>news:03ff01c3 6b47$9520f140$a 401280a@phx.gbl ...[color=darkred]
        >>> I have a Solution with two projects. I am trying to
        >>> reference a class in project2 from project1. When I
        >>> right click on the project1 references (in Solutions
        >>> explorer)and attempt to add a reference, I get the add
        >>> reference window, I click on Project tab and browse[/color][/color][/color]
        to[color=blue]
        >my[color=green][color=darkred]
        >>> solution/project folder and then to the project2.exe.
        >>> However, I recieve an error ... seems like it is[/color][/color]
        >looking[color=green][color=darkred]
        >>> for a file with a dll extenstion. I'm a rookie at
        >>> this ... but it seems so simple. Can anyone tell me[/color][/color]
        >how[color=green][color=darkred]
        >>> to reference a class within a project in the same
        >>> solution? Appreciate any ideas .... Thanks![/color]
        >>
        >>
        >>.
        >>[/color]
        >.
        >[/color]

        Comment

        Working...