Groups | Blog | Home
all groups > c# > august 2004 >

c# : Assembly.LoadFrom & CreateInstance problem with custom class


Bülent Üstün
8/30/2004 11:14:07 PM
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

Mattias Sjögren
8/31/2004 10:50:33 AM

[quoted text, click to view]

Try

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


[quoted text, click to view]

or use Activator.CreateInstanceFrom



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Bülent Üstün
8/31/2004 7:49:40 PM
Thanks for your reply. But that doesnt work either.

"Mattias Sjögren" <mattias.dont.want.spam@mvps.org>, iletide sunu yazdi
news:eM2aFezjEHA.2500@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button