Groups | Blog | Home
all groups > dotnet remoting > october 2007 >

dotnet remoting : Missing Tcp



Andrew Jarvis
10/4/2007 3:57:29 PM
Dear All,

I decided to experiment with remoting but fell at the first hurdle with the
error:

The type or namespace name 'Tcp' does not exist in the namespace
'System.Runtime.Remoting.Channels'


due to:

using System.Runtime.Remoting.Channels.Tcp;

Where do I go from here?

Regards,
Andrew

Spam Catcher
10/4/2007 8:51:47 PM
"Andrew Jarvis" <someone@somewhere> wrote in
news:OP48jbpBIHA.1168@TK2MSFTNGP02.phx.gbl:

[quoted text, click to view]

Add a reference to the System.Runtime.Remoting DLL.
Andrew Jarvis
10/5/2007 11:38:42 AM
Thanks for that.

I am new to C# and I assumed that 'using' was all you needed to let the
compiler know what was being referenced!


[quoted text, click to view]

Günter Prossliner
10/5/2007 1:08:46 PM
Hello Andrew!

[quoted text, click to view]

The "using" Directive just allows (lazy ;-) ) Programmers to avoid that all
Type-Names have to be fully qualified within the Source-File (or Namespace).
It also allows you to alias Namespaces or Types.

instead of writing:
using System;
Console.Writeline("Hello World!");

you are free to write:
System.Console.WriteLine("Hello World!");

or (with an Namespace-Alias):
using SYS = System;
SYS.Console.WriteLine("Hello World!");

or (with an Class-Alias)
using CON = System.Console;
CON.WriteLine("Hello World!");


So: It would be possible to write any C# Program without using "using" at
all.

References are a different thing. Without setting a Reference, the compiler
has no chance to know which Assembly defines the Type that is used within
the Code. This is not possible, because 1. there is no system-wide
repository (like the Registry for COM-ponents) the compiler can traverse to
find the Type and 2. there may be more than one Assembly that are defining a
Type named "System.Runtime.Remoting.Channels.Tcp.TcpChannel".

By setting the Reference you tell the compiler which to choose and where to
find the Type.



GP

AddThis Social Bookmark Button