if i have two projects in the a solution and i want to use exactly the same code file in this two projects, how do i create that file in one project and link to that file from the other?
I don't understand anything. do you need to merge the output of two projects to one file or what??
i dont understand too, i start to add some more functionality to a solution composed of 20 projects, and i see that there are some files which has a shortcut symbol, and i have been told that those .cs files refering to some concrete files in other projects, instead of repeating the code in various projects they are linked as a shortcut.
ooooh I got you.... but if you've the same functionality it's logical to deploy them as executable (e.g .dll) and refer to them from the projects need to use this logic..
Example
You've 10 projects should use some mathematical operations I do, I should deploy my operations in dll and refer to it from the 10 projects to use it and access it like you access .net library.
NOT to add code files of my operations in the 10 projects and use them, simply keep constancy in your mind, for sure in some stage you'll forget to update all files with the same operations or someone from your team needs the executable and they don't have time to read and compile the logic or keep this operations up-to-date with yours.
Last edited by Ramy Mahrous; Jan 30th, 2009 at 4:57 pm. Reason: remove some \n :D
but in our case it is not logical to create a dll for each individual .cs file, let say from the project A i need one class file, from project B i need another, i can not create thousands of dlls, do you know how to create links between files?
You can just create a folder under the solution (Right click on the solution node then create folder then drag drop items) but take care you just add a reference to files which is mainly located in projects that's mean, you can't add file to this folder from project1 and call its methods in project2.
can you create an example like this : add two windows application projects to one solution. and i just want to add one class file to windows project1 then link to it from windows project 2. i tried creating a folder under the solution, and if i drag a file from any of the projects it is linked to there, but if i drag from the folder under the solution to any of the projects, it is copied.
i think it`s better to divide ur programe.cs classes into more than DLL or u can alot of classes in one namspace ; but u can add project1 in solution and adding the project1 namespace in ur certain project the choose ur class ;
Hi,
I am having the exact same problem, I need to use the same source in multiple projects and don't feel like creating DLL:s and binaries for everything.
Obviously there must be a way to share source code in C#, that's one of the most basic functions of all programming languages.
Have this been resolved, please post how you did it to this thread..
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.