470,591 Members | 1,568 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

Load assembly dinamically

1
Hi,

I've the following problem. I load an assembly dinamically through code, but I can't call the method GetCredentials correctly, it's allways null.

Expand|Select|Wrap|Line Numbers
  1. Assembly assem = Assembly.LoadFrom(@"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI\Microsoft.SharePoint.Portal.SingleSignon.dll");
  2. Type typCred = assem.GetType("Microsoft.SharePoint.Portal.SingleSignon.Credentials");
  3. System.Type[] arrTypes = new System.Type[3];
  4. arrTypes.SetValue(Type.GetType("System.UInt32"), 0);
  5. arrTypes.SetValue(Type.GetType("System.String"), 1);
  6. arrTypes.SetValue(Type.GetType("System.String[]&"), 2);
  7.  
  8. MethodInfo miGetCred = typCred.GetMethod("GetCredentials", arrTypes);
  9. UInt32 UI32 = Convert.ToUInt32(1);
  10.  
  11. object[] arrParams = new object[3];
  12. arrParams.SetValue(UI32, 0);
  13. arrParams.SetValue(SSO_APPLICATION_NAME, 1);
  14. arrParams.SetValue(rgGetCredentialData, 2);
  15.  
  16. miGetCred.Invoke(null, arrParams); // Value is null and rgGetCredentialData also.
  17.  
I don't know what I'm doing wrong. Any help would be greatly appreciated.

Regards,
Thomas
Sep 7 '07 #1
0 784

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by John Alesse | last post: by
6 posts views Thread by Steve | last post: by
2 posts views Thread by chandu | last post: by
3 posts views Thread by Kojikabutosv | last post: by
2 posts views Thread by David Thielen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.