By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,824 Members | 1,247 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,824 IT Pros & Developers. It's quick & easy.

Load assembly dinamically

P: 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
Share this question for a faster answer!
Share on Google+

Post your reply

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