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
- Assembly assem = Assembly.LoadFrom(@"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI\Microsoft.SharePoint.Portal.SingleSignon.dll");
- Type typCred = assem.GetType("Microsoft.SharePoint.Portal.SingleSignon.Credentials");
- System.Type[] arrTypes = new System.Type[3];
- arrTypes.SetValue(Type.GetType("System.UInt32"), 0);
- arrTypes.SetValue(Type.GetType("System.String"), 1);
- arrTypes.SetValue(Type.GetType("System.String[]&"), 2);
- MethodInfo miGetCred = typCred.GetMethod("GetCredentials", arrTypes);
- UInt32 UI32 = Convert.ToUInt32(1);
- object[] arrParams = new object[3];
- arrParams.SetValue(UI32, 0);
- arrParams.SetValue(SSO_APPLICATION_NAME, 1);
- arrParams.SetValue(rgGetCredentialData, 2);
- miGetCred.Invoke(null, arrParams); // Value is null and rgGetCredentialData also.
Regards,
Thomas