469,658 Members | 1,872 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,658 developers. It's quick & easy.

Multiple Projects, single code file

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
Nov 19 '05 #1
1 1933
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" <jg**************@blah.leevalley.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl...
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

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Harry Whitehouse | last post: by
3 posts views Thread by Carl Johansen | last post: by
3 posts views Thread by Claudio Pacciarini | last post: by
2 posts views Thread by Jonathan Kacprowicz | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.