link to code file

Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 123
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

link to code file

 
0
  #1
Jan 30th, 2009
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?
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: link to code file

 
0
  #2
Jan 30th, 2009
I don't understand anything. do you need to merge the output of two projects to one file or what??
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 123
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: link to code file

 
0
  #3
Jan 30th, 2009
Originally Posted by RamyMahrous View Post
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.
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: link to code file

 
0
  #4
Jan 30th, 2009
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
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 123
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: link to code file

 
0
  #5
Jan 30th, 2009
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?
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: link to code file

 
0
  #6
Jan 30th, 2009
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.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 123
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: link to code file

 
0
  #7
Feb 1st, 2009
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.
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 46
Reputation: BlackSun is an unknown quantity at this point 
Solved Threads: 4
BlackSun BlackSun is offline Offline
Light Poster

Re: link to code file

 
0
  #8
Feb 2nd, 2009
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, 2 views)
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 4
Reputation: zig007 is an unknown quantity at this point 
Solved Threads: 1
zig007 zig007 is offline Offline
Newbie Poster

Re: link to code file

 
0
  #9
Mar 9th, 2009
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..
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 123
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: link to code file

 
0
  #10
Mar 9th, 2009
unfortunately it is not resolved, i was going to ask it to my supervisor but i couldnt because of my pride..
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 2281 | Replies: 22
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC