943,740 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 5828
  • C# RSS
You are currently viewing page 1 of this multi-page discussion thread
Jan 30th, 2009
0

link to code file

Expand Post »
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?
Similar Threads
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Jan 30th, 2009
0

Re: link to code file

I don't understand anything. do you need to merge the output of two projects to one file or what??
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006
Jan 30th, 2009
0

Re: link to code file

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.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Jan 30th, 2009
0

Re: link to code file

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
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006
Jan 30th, 2009
0

Re: link to code file

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?
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Jan 30th, 2009
0

Re: link to code file

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.
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006
Feb 1st, 2009
0

Re: link to code file

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.
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008
Feb 2nd, 2009
0

Re: link to code file

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 ;
Attached Files
File Type: zip DaniWeb4.zip (48.6 KB, 110 views)
Reputation Points: 28
Solved Threads: 5
Light Poster
BlackSun is offline Offline
46 posts
since Feb 2008
Mar 9th, 2009
0

Re: link to code file

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..
Reputation Points: 10
Solved Threads: 1
Newbie Poster
zig007 is offline Offline
4 posts
since Mar 2009
Mar 9th, 2009
0

Re: link to code file

unfortunately it is not resolved, i was going to ask it to my supervisor but i couldnt because of my pride..
Featured Poster
Reputation Points: 854
Solved Threads: 127
Banned
serkan sendur is offline Offline
2,057 posts
since Jan 2008

This thread is solved

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.
Message:
Previous Thread in C# Forum Timeline: C#: Passing data from one windows form to another
Next Thread in C# Forum Timeline: weird issue





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC