0

I'm facing a problem loading via refletion my class.

this code:

PublishingClass = Type.GetType("CONST STRING FULLY QUALIFIED", true);

Works if I'm in a console app but fails (Could not Load "CONST STRING FULLY QUALIFIED") if I'm in Sharepoint context.

Why some classes loads from the same DLL and other not?

Why from console app all class loads EVERY CLASS and from sharepoint no?

I'm running on my machine, copying to gac, resetting IIS and recycling AppPool..

Any suggestion?

Thank you very much!

Ziba Leah
  • 2,484
  • 7
  • 41
  • 60
  • Do you include the full assembly information? Like for `string` it's: `System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089` I know for some platforms (not sure about sharepoint) you need _all_ of that information to resolve a type. – Chris Sinclair Dec 13 '12 at 17:47
  • Can you provide the _actual_ string you're using instead of `"CONST STRING FULLY QUALIFIED"`? – Chris Sinclair Dec 13 '12 at 17:52
  • Type.GetType("NTV.GI.InformationsPublishingModules.clPublish_NOE_InfoPanelAlto,NTV.GI.DefaultPublishingModules, Version=1.0.0.0, Culture=neutral, PublicKeyToken=058a5c6182ba3fb9") – Ziba Leah Dec 17 '12 at 09:10

1 Answers1

0

You already try with that?

Type.GetType("CONST STRING FULLY QUALIFIED, AssemblyName");
Dav
  • 330
  • 2
  • 10
  • It's not `namespaceName`, that should be `AssemblyName`. – Chris Sinclair Dec 13 '12 at 17:49
  • Type.GetType("NTV.GI.InformationsPublishingModules.clPublish_NOE_InfoPanelAlto,NTV.GI.DefaultPublishingModules, Version=1.0.0.0, Culture=neutral, PublicKeyToken=058a5c6182ba3fb9") – Ziba Leah Dec 17 '12 at 09:10