Reference in C#

  • Thread starter Thread starter Irfan
  • Start date Start date
I

Irfan

hi,
C Sharp how to add references so that they are accessible to all the files
in that project. Everytime a create a new file,
i have to copy all the 'Using' Statement to that new file. In VB.net we do
it by going to the Project Properties and the referaces are declared
globally. How can it be done in C#

TIA
Irfan
 
Referenced assemblies are available to all files in a project. A using
statment merely enables you to refer to a class in an assembly without
typing the full namespace.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Shooter
http://unclechutney.blogspot.com

A man, a plan, a canal, a palindrome that has.. oh, never mind.
 
Thanks Kevin,
Actually I meant the referencing of the individual classes in the
namespace.

If i have referanced Namespaces "MyLibrary" and i want to use
MyLibrary.CircleLib in every file in my project. How do i
do it. Do i have to use 'Using MyLibrary.CircleLib' in every file?

In VB i would have just gone to the project properties and added
MyLibrary.CircleLib, which would have set it globally.
I was expected a similar thing in C#? Is it not possible?

Thanks,
Irfan
 
That was because you were referencing a module. While creating modules is
possible in C#, it's not easily done, and that's because it's not a good
idea.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Shooter
http://unclechutney.blogspot.com

A man, a plan, a canal, a palindrome that has.. oh, never mind.
 
Irfan said:
Thanks Kevin,
Actually I meant the referencing of the individual classes in the
namespace.

If i have referanced Namespaces "MyLibrary" and i want to use
MyLibrary.CircleLib in every file in my project. How do i
do it. Do i have to use 'Using MyLibrary.CircleLib' in every file?

In VB i would have just gone to the project properties and added
MyLibrary.CircleLib, which would have set it globally.
I was expected a similar thing in C#? Is it not possible?

There's no such facility in any .NET language except VB, as far as I know.

-cd
 
Back
Top