Hi My Friends,
In WellKnownServiceTypeEntry WKSTE = new
WellKnownServiceTypeEntry(typeof(ServiceClass),"HttpService",
WellKnownObjectMode.SingleCall);
I use typeof(ServiceClass) and it works. I used Type.GetType( "ServiceClass
"), it doesn't work. I checked the document of typeof() and Type.GetType(),
I could not find out the diffrentce. Would you like to tell me ?
Regards,
Larry
Sean Hederman - 08 Jun 2005 06:06 GMT
> Hi My Friends,
>
[quoted text clipped - 6 lines]
> Type.GetType(), I could not find out the diffrentce. Would you like to
> tell me ?
Well the fact that one takes a static type reference and the other a type
name would be a start. Type.GetType is evaluated at runtime, whilst typeof
is evaluated at compile time. Type.GetType should be passed in a qualified
name rather than a partial name as this will make it easier for it to
resolve the type (e.g. Type.GetType("MyNamespace.MyClass, MyAssembly")).
And another difference would be that Type.GetType is part of the CLR
Framework whilst typeof is a C# keyword.
laurence chang - 09 Jun 2005 15:31 GMT
Hello Sean Hederman
Thank you very much for your help.
I tried use qualified name of the type.
Type.GetType("RemoteAccessComponents.FlightBookings",true);
It seems Type.GetType can only get type from current assembly, even I
add refrence to another assembly, it still can not return the type. but
typeof can do it.
Laurence
Sean Hederman - 10 Jun 2005 05:42 GMT
> Hello Sean Hederman
>
> Thank you very much for your help.
> I tried use qualified name of the type.
> Type.GetType("RemoteAccessComponents.FlightBookings",true);
Lawrence, that is not a qualified name, that's a partial name. A qualified
name includes the name of the assembly after a comma, so if your type is
FlightBookings and the namespace it is in is RemoteAccessComponents and the
assembly it is in is RACAssembly you'd use:
Type.GetType("RemoteAccessComponents.FlightBookings, RACAssembly");
champak mehta - 24 Jul 2006 15:46 GMT