Home All Groups Group Topic Archive Search About
Author
16 Oct 2006 11:59 AM
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

Author
16 Oct 2006 12:56 PM
Kevin Spencer
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.

Show quote
"Irfan" <ir***@asc-ltd.co.uk> wrote in message
news:OgHM%23pR8GHA.608@TK2MSFTNGP03.phx.gbl...
> 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
>
>
>
Author
16 Oct 2006 1:20 PM
Irfan
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


Show quote
"Kevin Spencer" <spam@uce.gov> wrote in message
news:eilKrJS8GHA.536@TK2MSFTNGP04.phx.gbl...
> 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.
>
> "Irfan" <ir***@asc-ltd.co.uk> wrote in message
> news:OgHM%23pR8GHA.608@TK2MSFTNGP03.phx.gbl...
>> 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
>>
>>
>>
>
>
Author
16 Oct 2006 5:41 PM
Kevin Spencer
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.

Show quote
"Irfan" <ir***@asc-ltd.co.uk> wrote in message
news:OxmDtXS8GHA.940@TK2MSFTNGP03.phx.gbl...
> 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
>
>
> "Kevin Spencer" <spam@uce.gov> wrote in message
> news:eilKrJS8GHA.536@TK2MSFTNGP04.phx.gbl...
>> 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.
>>
>> "Irfan" <ir***@asc-ltd.co.uk> wrote in message
>> news:OgHM%23pR8GHA.608@TK2MSFTNGP03.phx.gbl...
>>> 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
>>>
>>>
>>>
>>
>>
>
>
Author
16 Oct 2006 6:34 PM
Carl Daniel [VC++ MVP]
"Irfan" <ir***@asc-ltd.co.uk> wrote in message
news:OxmDtXS8GHA.940@TK2MSFTNGP03.phx.gbl...
> 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
Author
17 Oct 2006 1:04 PM
Irfan
thanks for all your replies which cleared my doubt.

irfan



Show quote
"Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@mvps.org.nospam>
wrote in message news:e4bpoGV8GHA.2268@TK2MSFTNGP05.phx.gbl...
> "Irfan" <ir***@asc-ltd.co.uk> wrote in message
> news:OxmDtXS8GHA.940@TK2MSFTNGP03.phx.gbl...
>> 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
>
>

AddThis Social Bookmark Button