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

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
 
F

Family Tree Mike

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.
 
S

surturz

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
 
C

CMoya

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.
 
C

CMoya

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?
 
F

Family Tree Mike

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.
 
F

Family Tree Mike

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top