importing classes across projects

Hi,

I can't seem to find the right settings to do something very simple.  I have one solution with two projects, both of which are windows executable output.  I want one project to be able to import classes that are part of the other project.  I get compiler error vjs1161 no matter what I add to the references path.  Can anyone tell me what I'm missing

As an example, consider the projects to be a game and a map editor for the game.  I need to map editor to access classes that are part of the game.

Thanks for any help.



Answer this question

importing classes across projects

  • Samer Selo

    Thanks very much.  I don't know how I missed that projects tab in the Add Reference dialogue.
  • JanT [MVP]

    Hi,

    You need to add project reference to the project which has the classes/interface defined. You can do it as follows...

    Lets assume you have 2 projects A & B. B has the classes defined and A wants to consume them.

    1. Open Solution Explorer. It will be opened by default.

    2. Right click on Project A in solution Explorer.

    3. Click Add Reference.

    4. Click on the project Tab.

    5. Select Project B and click ok.

    6. Compile your project.

    Please post back if it doesn't help.

    Thanks.

     



  • importing classes across projects