views:

87

answers:

1

I have tried this, specifying the assembly name:

Type.GetType(string.Format("{0}.{1}, {0}", typeToLoad.AssemblyName, typeToLoad.ClassName));

Which throws the following:

The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest

Trying the same without including the trailing assembly name like this:

Type.GetType(string.Format("{0}.{1}", typeToLoad.AssemblyName, typeToLoad.ClassName));

-- returns null.

So, I am looking for a way to instantiate a class by providing its fully qualified name in Silverlight 4.0.

Any ideas would be greatly appreciated, Thanks.

+1  A: 

I had the same issue and it worked when I tried the assembly qualified type name in the following format :

", , Version="", Culture=, PublicKeyToken="

joe-AnSo
Thanks user430282. Could you please just be a bit more specific with your code.
ondesertverge
OKAY! `Type.GetType(string.Format("{0}.{1}, {0}, Version=1.0.0.0, Culture=\"\", PublicTokenKey=null", typeToLoad.AssemblyName, typeToLoad.ClassName))` finally did the trick. Thanks to user430282 for the tip that set me in the right direction (after waiting for two months).
ondesertverge