Assembly.LoadFrom & CreateInstance problem with custom class

B

Bülent Üstün

Hi, i've a DLL file which contains a class i wrote named up2date (its not
windows.forms).
Which contains a constructor
public up2date(string url,string domain)

Now i want to load this DLL & use that class.
I load the assembly with
Assembly i = Assembly.LoadFrom( "update.dll" );

When i used

i.CreateInstance("up2date.up2date(\"http://mute.no-ip.com/phpupdate/\",\"up2
date\")");
it didnt work.

So i tried
Activator.CreateInstance( "update.dll" , "up2date" , new object[] {
"http://mute.no-ip.com/phpupdate/","up2date" } );


But this time it gives a Type unknown or file not found error.
What must be the type of custom classes? Or anyone have any solution to use
that class?
Any help would be appreciated.
Thanks
 
B

Bülent Üstün

Thanks for your reply. But that doesnt work either.

iletide sunu yazdi said:
When i used

i.CreateInstance("up2date.up2date(\"http://mute.no-ip.com/phpupdate/\",\"up
2
date\")");
it didnt work.

Try

i.CreateInstance("up2date", false, 0, null, new object[]
{"http://mute.no-ip.com/phpupdate/","up2date"}, null, null);

So i tried
Activator.CreateInstance( "update.dll" , "up2date" , } );

or use Activator.CreateInstanceFrom



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top