I am not sure of your requirement,you might be interested in using the
Extern keyword in C#. It doesnt necessarily shares the file but you can
import the DLL and use its methods. Using an extern modifier, means the
code is implemented externally.
Use the sample code snippet from MSDN.
using System;
using System.Runtime.InteropServices;
class MyClass
{
[DllImport("User32.dll")]
public static extern int MessageBox(int h, string m, string c, int type);
public static int Main()
{
string myString;
Console.Write("Enter your message: ");
myString = Console.ReadLine();
return MessageBox(0, myString, "My Message Box", 0);
}
}
On Tue, Apr 14, 2009 at 7:05 PM, Stephen Russell <[email protected]>wrote:
> Have you added the second project to the first one’s Solution?
>
>
>
> If so put in your using or imports statement and it is there.
>
>
>
>
>
>
>
> …………………………………………………………………
>
> Stephen Russell –
>
> Senior Visual Studio Developer, DBA
>
>
>
> Memphis, TN
>
> 901.246-0159
>
>
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Carlos Arias
> *Sent:* Monday, April 13, 2009 5:33 PM
> *To:* [email protected]
> *Subject:* [DotNetDevelopment] 1 file into 2 projects
>
>
>
> Hi, How can i work with 2 projects that share a code file?
>
>
>
> the first solution was add the same file into the 2 projects but i only
> want to have in 1 and in the other one only the link or i don´t know.
>
> thanks everybody!!!
>
> --
> Carlos Andrés Arias Blanco
> 8864-3573
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.287 / Virus Database: 270.11.54/2056 - Release Date: 04/13/09
> 05:51:00
>