472,782 Members | 1,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 software developers and data experts.

Load assembly dinamically


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);
  8. MethodInfo miGetCred = typCred.GetMethod("GetCredentials", arrTypes);
  9. UInt32 UI32 = Convert.ToUInt32(1);
  11. object[] arrParams = new object[3];
  12. arrParams.SetValue(UI32, 0);
  13. arrParams.SetValue(SSO_APPLICATION_NAME, 1);
  14. arrParams.SetValue(rgGetCredentialData, 2);
  16. miGetCred.Invoke(null, arrParams); // Value is null and rgGetCredentialData also.
I don't know what I'm doing wrong. Any help would be greatly appreciated.

Sep 7 '07 #1
0 840

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

Similar topics

by: Greg Patrick | last post by:
My problem: I load an some assemblies (strong named) from a byte array using Assembly.Load(byte). They load fine. But one one of them is actually accessed, it's referenced assemblies can't be...
by: John | last post by:
Hi, I tried to load a mixedmode dll (MC++) with AppDomain.Load(Byte ) in a C# Client. During the Load Process I got the following Exception: System.IO.FileLoadException: Ausnahme von...
by: John Alesse | last post by:
Hi, I've created a very simple winforms control using the c# wizard in VS .net 2003 that is nothing but a System.Windows.Forms.UserControl. There are no other controls on the form It takes IE 12...
by: Steve | last post by:
I'm playing with late binding and trying a very simple test to load an assembly In my "Host" application I have this code: <code> string modulePath =...
by: chandu | last post by:
Hello, I developed one windows appliction . and i want to load that application dinamiclly in a Parent MDI as child appliction when click on a button in parent form.. Just i tried to load the...
by: chandu | last post by:
I want to load an assembly dinamically into another application with a button click. how to load and execute that dinamic assebly.. i tried like this copied that target assebly in bin folder...
by: Peter | last post by:
Hi I can create types from dynamic loaaded assemblies (Assembly.Load) with Assembly.GetTyp( <typename) - OK I need a reference to the assembly (just Type.GetType() do not work ) now my...
by: Kojikabutosv | last post by:
Hi everybody, i have a master page and with tree buttons, how configure the buttons to load pages dinamically in wichone pages. Regards,
by: David Thielen | last post by:
So we have moved our app from .NET version 2.X in IIS6 to a Windows 2008 Server running IIS7. We have copied all files to the Windwardreports\apps directory and that apps directory has been...
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
by: Mushico | last post by:
How to calculate date of retirement from date of birth
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.