I have two C#.net projects project 1 and project 2 (names changed) in single solution. I am using Visual Studio 2005. I have added reference of project 2 in project 1 by rig
Make sure the classes you want to access are public. So suppose you have the following class in Project 2:
namespace Project2
{
public class Foo { }
}
In Project 1 after you've referenced Project 2 you can use this class:
namespace Project1
{
using Project2;
public class Bar
{
public Bar()
{
Foo foo = new Foo();
}
}
}
Import
is a Visual Basic.NET term. In C# you would use using
.