Where to get a namespace?

  • Thread starter Thread starter William Stacey
  • Start date Start date
W

William Stacey

Did you add the "using System.Runtime.InteropServices;" to the top of your
cs file?
 
For the last few weeks I have been learning the C#
language. I use the standard edition pacakge and like
the language. I have used several books for knowledge
and coding practice.
I am now working on Charles Petzhold's book Programming
MS Windows with C#. In chapter 6, he called for a
namespace System.Runtime.InteropServices. This does not
appear to be part of the standard package.
My question: can I avoid upgrading to the next level of
C#, the professional edition, by obtaining an MSDN
Library level subscription and getting the namespace from
there?
 
John said:
For the last few weeks I have been learning the C#
language. I use the standard edition pacakge and like
the language. I have used several books for knowledge
and coding practice.
I am now working on Charles Petzhold's book Programming
MS Windows with C#. In chapter 6, he called for a
namespace System.Runtime.InteropServices. This does not
appear to be part of the standard package.
My question: can I avoid upgrading to the next level of
C#, the professional edition, by obtaining an MSDN
Library level subscription and getting the namespace from
there?

Having MSDN is always a good idea, (but not neccecary, if you've an internet
connection).
What you are missing is an assembly reference.
Go to References on the Solution Explorer and right click it, choose add
reference and choose the currect dll.
 
John said:
For the last few weeks I have been learning the C#
language. I use the standard edition pacakge and like
the language. I have used several books for knowledge
and coding practice.
I am now working on Charles Petzhold's book Programming
MS Windows with C#. In chapter 6, he called for a
namespace System.Runtime.InteropServices. This does not
appear to be part of the standard package.

What problem are you having? It's in mscorlib.dll, so it should be
fine.
 
System.Runtime.InteropServices exists in .Net Framework 1.0. You don't have
to upgrade anything.

-vJ
 
William Stacey said:
Did you add the "using System.Runtime.InteropServices;" to the top of your
cs file?

And as for the big picture. You have the WHOLE of C# and the WHOLE .NET
framework. These are free. You only have the standard edition of Visual
Studio .NET.

If you want to compile your code using the command-line compiler csc.exe,
there is no feature or function of .NET or C# you cannot use.

David
 
Your suggestion to include the reference to mscorlib in
the assembly did the trick; the other replies were less
specific and therefore not helpful.
Thanks.
 
John said:
Your suggestion to include the reference to mscorlib in
the assembly did the trick; the other replies were less
specific and therefore not helpful.

You shouldn't need to *explicitly* have a reference to mscorlib - it's
always in there automatically.
 
Back
Top