Monday, January 02, 2006

How to share files between multiple files without making a class library

As I continue programming in c#, I have some classes that are shared between various projects. And I know that it is not a very good Idea to have exactly the same files placed in the different projects.

I have been looking for a way of doing this, and the only solution seemed to create a class library, compile it to a DLL file and add a reference to this class library in all the projects. I don“t like this solution because I prefer that a program fits only in one EXE file.

After looking a little more, I have found a easy solution. When you add the .cs file that you want to share, (Menu project, add existing file), select in the the right bottom button of the window the option "Link".

Sharing the files in this way seems to cause small problems in the control version software that we use (P4Q), but it seems very easy to work in this way.

0 Comments:

Post a Comment

<< Home