all groups > vb.net > january 2008 >
You're in the

vb.net

group:

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


newbie in .net: working with 1 file in multiple projects Guy Cohen
1/6/2008 11:09:01 PM
vb.net:

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


RE: newbie in .net: working with 1 file in multiple projects Family Tree Mike
1/7/2008 4:06:01 AM
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.

[quoted text, click to view]
RE: newbie in .net: working with 1 file in multiple projects surturz
1/7/2008 5:05:06 PM
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

[quoted text, click to view]
Re: newbie in .net: working with 1 file in multiple projects CMoya
1/7/2008 8:12:03 PM
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.

[quoted text, click to view]
Re: newbie in .net: working with 1 file in multiple projects CMoya
1/7/2008 8:18:19 PM
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?

"Family Tree Mike" <FamilyTreeMike@discussions.microsoft.com> wrote in
message news:D2D3DA72-FB1E-40D8-BD84-A094A1842DAF@microsoft.com...
[quoted text, click to view]
Re: newbie in .net: working with 1 file in multiple projects Family Tree Mike
1/8/2008 3:51:00 AM
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.

[quoted text, click to view]
Re: newbie in .net: working with 1 file in multiple projects Family Tree Mike
1/8/2008 4:06:00 AM
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.

[quoted text, click to view]
AddThis Social Bookmark Button