using common classes and enums for all projects in a Solution

Discussion in 'ASP .Net' started by Nariban Barkan, Jun 11, 2008.

  1. Hi All,
    I am using VS.2008 and I have one windows apllication project and two web
    project in my solution.

    How can i use common classes and enums for all projects ?

    I add "Solution Items" folder in my Solution and create a class in that
    folder but i can not reach that class from any of the projects ..

    Thanks in advance.
    Nariban Barkan, Jun 11, 2008
    #1
    1. Advertising

  2. On Jun 11, 10:45 am, "Nariban Barkan" <> wrote:
    > I am using VS.2008 and I have one windows apllication project and two web
    > project in my solution.
    >
    > How can i use common classes and enums for all projects ?
    >
    > I add "Solution Items" folder in my Solution and create a class in that
    > folder but i can not reach that class from any of the projects ..


    Create a class library project, and then add a reference to that
    project from each of the others.

    Jon
    Jon Skeet [C# MVP], Jun 11, 2008
    #2
    1. Advertising

  3. Nariban Barkan

    Marc Gravell Guest

    Note that if you are using web-references (i.e. asmx etc) then things
    get more interesting. I just answered something very similar over in:
    microsoft.public.dotnet.framework ("Annoying Web Service Compilation
    Issue").

    Marc
    Marc Gravell, Jun 11, 2008
    #3
  4. Thanks ....
    Nariban Barkan, Jun 11, 2008
    #4
  5. Nariban Barkan

    Brian Gideon Guest

    On Jun 11, 4:45 am, "Nariban Barkan" <> wrote:
    > Hi All,
    > I am using VS.2008 and I have one windows apllication project and two web
    > project in my solution.
    >
    > How can i use common classes and enums for all projects ?
    >
    > I add "Solution Items" folder in my Solution and create a class in that
    > folder but i can not reach that class from any of the projects ..
    >
    > Thanks in advance.


    For what's it worth I do find that method of sharing code useful in
    one particular case. That is to share the assembly level attributes
    for product and version information. From each project in the
    solution you can "link" in a file from outside the project by clicking
    the down arrow on the Add button in the Add Existing File dialog box
    and chosing Add as Link.
    Brian Gideon, Jun 11, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nick Wouters
    Replies:
    1
    Views:
    536
    Kevin Spencer
    May 27, 2005
  2. =?utf-8?b?QXNiasO4cm4gU8OmYsO4?=

    Enums without identifier, enums and typedef

    =?utf-8?b?QXNiasO4cm4gU8OmYsO4?=, Jan 19, 2007, in forum: C Programming
    Replies:
    10
    Views:
    1,097
    Keith Thompson
    Jan 20, 2007
  3. Denny
    Replies:
    1
    Views:
    761
  4. August0866
    Replies:
    1
    Views:
    106
    Sebastian Hungerecker
    Mar 17, 2008
  5. Jason Mellone
    Replies:
    3
    Views:
    78
    Jurko Gospodnetić
    May 7, 2014
Loading...

Share This Page