Multiple Projects, single code file

Discussion in 'ASP .Net' started by Jody Gelowitz, Mar 11, 2005.

  1. Within ASP.NET, is it possible to use a single .vb file and have it shared
    (or accessed) between multiple projects without having that file being
    copied to each project folder?

    ie.
    C:\Projects\MyProject1 (project 1)
    C:\Projects\MyProject2 (project 2)
    C:\Projects\CommonFiles\MyCommonFile.vb (common file directly accessed
    and compiled from Project1 and Project2)

    The error that I get when manually editing the project file to do this is:
    "The file '...{filename}' could not be added to hte project. The specified
    path contains invalid characters, is an absolute path, or is a path outside
    of the project directory."

    I realize that another option would be to take what is in "CommonFiles" and
    compile that into its own assembly, then reference that assembly between the
    2 projects. But, I would like to explore the option of having each project
    point to a common file and include that code into each compiled assembly
    first.

    Thanks,
    Jody
    Jody Gelowitz, Mar 11, 2005
    #1
    1. Advertising

  2. What you need to do is compile
    MyCommonFile.vb and place it in the GAC.

    There it will be available to all applications.



    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en EspaƱol
    Ven, y hablemos de ASP.NET...
    ======================

    "Jody Gelowitz" <> wrote in message
    news:...
    > Within ASP.NET, is it possible to use a single .vb file and have it shared
    > (or accessed) between multiple projects without having that file being
    > copied to each project folder?
    >
    > ie.
    > C:\Projects\MyProject1 (project 1)
    > C:\Projects\MyProject2 (project 2)
    > C:\Projects\CommonFiles\MyCommonFile.vb (common file directly accessed
    > and compiled from Project1 and Project2)
    >
    > The error that I get when manually editing the project file to do this is:
    > "The file '...{filename}' could not be added to hte project. The
    > specified path contains invalid characters, is an absolute path, or is a
    > path outside of the project directory."
    >
    > I realize that another option would be to take what is in "CommonFiles"
    > and compile that into its own assembly, then reference that assembly
    > between the 2 projects. But, I would like to explore the option of having
    > each project point to a common file and include that code into each
    > compiled assembly first.
    >
    > Thanks,
    > Jody
    >
    Juan T. Llibre, Mar 11, 2005
    #2
    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. David L?pez

    Multiple projects vs single project

    David L?pez, Nov 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    431
    Teemu Keiski
    Nov 18, 2003
  2. Andy G

    single solution-multiple projects

    Andy G, Jan 26, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    412
    Andy G
    Jan 26, 2005
  3. David Herbst
    Replies:
    1
    Views:
    503
    David Herbst
    Feb 1, 2006
  4. David Herbst
    Replies:
    0
    Views:
    390
    David Herbst
    Jan 18, 2006
  5. sumit chawla
    Replies:
    1
    Views:
    535
    Thomas Matthews
    Jul 13, 2004
Loading...

Share This Page