Connecting Tech Pros Worldwide Forums | Help | Site Map

Sharing c# library source files?

Newbie
 
Join Date: Jan 2008
Posts: 13
#1: Jan 10 '08
ok i'm new to .net and c#, so this maybe a dumb question to some of you!

but why can't i have a folder containing all my reusable classes without it being copied ( duplicated ) over to the project folder?

if i ever need to modify the library-file it seems i need to search through all my project folders and then replace them with the updated file. a lot of work for something that was commonly used in c/c++.

am i missing something? ( sorry if this is common knowledge to you guys )...

thanks for reading, any replies welcome.

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: Jan 10 '08

re: Sharing c# library source files?


Build a library(DLL) with all your re-usable classes.
Then you can just reference the DLL in your projects.
Newbie
 
Join Date: Jan 2008
Posts: 13
#3: Jan 10 '08

re: Sharing c# library source files?


well thanks for the quick reply, must say it was the quickest response i've ever had :)

ok i'd have to agree with your answer if i were grouping together similar functions, but if were talking reference variables and/or small dissimilar functions then it doesn't make sense.

oh well if that's how c# works then theres nothing either of us can do about it,
thanks again for your help.
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#4: Jan 10 '08

re: Sharing c# library source files?


I'm not sure what you ment that you could do it in C++?
You have libraries of files in C++ that you reference, just like you reference your DLL.
If you want, somewhere in visual studio properties, you can decide paths to locations where your files can be found. Like a search path where it will look for classes.
I don't remember where you do this but I think you can.
Newbie
 
Join Date: Aug 2009
Posts: 1
#5: Aug 25 '09

re: Sharing c# library source files?


Menu Add-->Existing Item

Select the file to Add

Click on the "Down Arrow" on the Add button

Select "Add as link"
Reply