newbie in .net: working with 1 file in multiple projects

  • Thread starter Thread starter Guy Cohen
  • Start date Start date
G

Guy Cohen

Hi all
I made some common used classes (e.g. config reader, email sender, user
login class).

When I add them to the project - a copy of the file is being made.

How do I avoid that?

I want them to stay in (e.g.): c:\myfiles\vb\common classes
So if I update them - all projects will be with latest updates?

TIA
Guy Cohen
 
I would strongly recommend making a class library project which contains your
common/utility classes. As you need the classes in other projects, add a
reference to the dll. This will make maintanance much easier in the long run.
 
I prefer creating a separate Project for the common code, then adding the
Project to each Solution.

That way you can see the common code in each Solution. If you have the same
common Project in two Solutions, and they are both open, VB 2005 is even
smart enough to warn you if you change the common code in one or the other
Solution.

-SurturZ
 
Yeah. I agree. Sometimes with "utility" helper functions, I find that I
fairly often want to tweak them as new situations arise or add new methods
as I think of them while working on a project. Simply adding a reference to
the compiled DLL is a bit productivity killing. I think adding the classes
as a Link (as I described) or using your technique (good too) is just way
more convenient.
 
But it makes tweaking them and adding new functions (very common with
utility/helper classes) laborious. How is your suggestion easier to maintain
than the "Add Item As Link" feature or using Surturz technique described in
this thread?
 
I understand and agree so long as you are careful to not make a breaking
change when going back to one of the other projects.
 
For me, it seems easier to determine which one dll needs an update for a
patch, rather than finding which multiple dlls refer to the class, to be
built for the patch.

It really comes down to how the team builds and distributes software. I
appologize for implying that the way we do it was best for everyone. I will
say it works for us.
 
Back
Top