Type.TypeOf doesn't work ?

  • Thread starter Thread starter lothar.behrens
  • Start date Start date
L

lothar.behrens

Hi,

I have some code, where I am using a variable for a given interface.
One step later, using Remoting, I need Type.TypeOf("...")

The following code returns Nothing, but the type above could be
declared for a variable.

Dim appMgr As MyInterfaces.IFoo

Dim myType As System.Type = Type.GetType("MyInterfaces.IFoo")

' myType is Nothing !!

Dim prx As MarshalByRefObject = Activator.GetObject(myType,
completeurl)

Any ideas ?

Thanks, Lothar
 
hi lothar
Are you sure you need quotes in your gettype ?

-tom

(e-mail address removed) ha scritto:
 
My guess would be that the name you are using is not fully qualified. If
this is defined in your application try
<PlaceYourAppRootNamespaceHere>.MyInterfaces.IFoo. If another DLL and you
imported the names, still use the full qualified name. If in doubt about the
fully qualified name, use the object browser to see the full qualified
name...
 
Lothar,

I don't believe it is the problem, but the information on MSDN on Gettype
for VBNet is lousy.

In VBNet it is normally easier to use Gettype(System.String)

Just as addition to Patrice,

Cor
 
Yes,

after reading about GetType, I have changed it to
GetType(Assembly.ClassTypeName).

This works for now, but I am in trouble with FileNotFoundException on
server side.
Maybe my app.config for the remoting configuration is not correct:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<channels>
<!-- Some chanels -->
</channels>
<service>
<wellknown type="Voil.VPMApplicationManager, VPMApplicationManager"
objectUri="VPMApplicationManager.rem" mode="Singleton" />
</service>
<RemoteServer>localhost</RemoteServer>
</application>
</system.runtime.remoting>

</configuration>

I'll do research on it, too :-)

Lothar
 
I have it, and it works :-)

<wellknown type="Voil.VPMApplicationManager, Voil">

Thanks, Lothar
 
Back
Top