Click here to Skip to main content
15,896,557 members
Home / Discussions / C#
   

C#

 
AnswerRe: Image's path Pin
Not Active8-Jun-07 4:53
mentorNot Active8-Jun-07 4:53 
GeneralRe: Image's path Pin
Nine_8-Jun-07 15:56
Nine_8-Jun-07 15:56 
GeneralRe: Image's path Pin
Not Active9-Jun-07 2:23
mentorNot Active9-Jun-07 2:23 
QuestionPrompt user to close outlook during install/uninstall Pin
Aerukull8-Jun-07 4:33
Aerukull8-Jun-07 4:33 
AnswerRe: Prompt user to close outlook during install/uninstall Pin
AikinX9-Jun-07 0:30
AikinX9-Jun-07 0:30 
QuestionIList and BindingSource Problem [modified] Pin
Wjousts8-Jun-07 3:42
Wjousts8-Jun-07 3:42 
AnswerRe: IList and BindingSource Problem Pin
Wjousts8-Jun-07 15:25
Wjousts8-Jun-07 15:25 
QuestionForm Application with Plugins via assembly loading Pin
ATCsharp8-Jun-07 2:47
ATCsharp8-Jun-07 2:47 
I am currently developing a Form that will scan a plugins directory and load any dll files that have a baseType of "MadPages.PageBase"

For proof of concept, I created a Control that extended the PageBase class. The form application found the dll file and loaded it into the application as planned.

My new problem is this. I have a new project in the solution named ProjectA. ProjectA is another control library that extends the PageBase class. ProjectA has a reference to another project which I called ProjectB. When my form application finds the DLL file for ProjectA, I do a foreach loop on the dll file's GetTypes().

This of course now comes up with 2 types...PageBase and ProjectB. When I try to dynamically load the Type PageBase into a local PageBase variable, I get an exception stating that it cannot find the dll for ProjectB. If I add a reference to my main form's project (pointing to to ProjectB), the application can load ProjectA. I know I must be doing something wrong.

The point of having these plugins was so I don't have to touch the main form's project when I want to extend it. Please let me know what I am doing wrong. Here is the code on how i'm loading my dll files from the plugin-dir:

Assembly asm= Assembly.LoadFile(path);
foreach (Type t in asm.GetTypes())
{
if (t.BaseType.ToString() == "MadPages.PageBase")
{
return (PageBase)t.GetConstructors()[0].Invoke(new object[] { });
}
}

There is only one constructor for the PageBase class. Thanks!




AnswerRe: Form Application with Plugins via assembly loading Pin
ATCsharp8-Jun-07 3:01
ATCsharp8-Jun-07 3:01 
GeneralRe: Form Application with Plugins via assembly loading Pin
Not Active8-Jun-07 3:12
mentorNot Active8-Jun-07 3:12 
GeneralRe: Form Application with Plugins via assembly loading Pin
ATCsharp8-Jun-07 3:23
ATCsharp8-Jun-07 3:23 
GeneralRe: Form Application with Plugins via assembly loading Pin
Not Active8-Jun-07 3:28
mentorNot Active8-Jun-07 3:28 
QuestionPlay MKV files in embedded media player Pin
sypack8-Jun-07 2:16
sypack8-Jun-07 2:16 
AnswerRe: Play MKV files in embedded media player Pin
Bekjong8-Jun-07 2:32
Bekjong8-Jun-07 2:32 
GeneralRe: Play MKV files in embedded media player Pin
sypack8-Jun-07 2:37
sypack8-Jun-07 2:37 
QuestionEncryption and Decryption Pin
M. J. Jaya Chitra8-Jun-07 2:15
M. J. Jaya Chitra8-Jun-07 2:15 
AnswerRe: Encryption and Decryption Pin
Sathesh Sakthivel8-Jun-07 2:19
Sathesh Sakthivel8-Jun-07 2:19 
AnswerRe: Encryption and Decryption Pin
Pixinger778-Jun-07 3:10
Pixinger778-Jun-07 3:10 
GeneralRe: Encryption and Decryption Pin
originSH8-Jun-07 3:48
originSH8-Jun-07 3:48 
AnswerRe: Encryption and Decryption Pin
Russell Jones8-Jun-07 4:39
Russell Jones8-Jun-07 4:39 
QuestionSQL Connection DialogBox Pin
ScottM18-Jun-07 2:07
ScottM18-Jun-07 2:07 
QuestionPacking a class into a byte array - would [Serializable] do the trick? Pin
Dewald8-Jun-07 2:02
Dewald8-Jun-07 2:02 
AnswerRe: Packing a class into a byte array - would [Serializable] do the trick? Pin
AikinX8-Jun-07 2:16
AikinX8-Jun-07 2:16 
GeneralRe: Packing a class into a byte array - would [Serializable] do the trick? Pin
Dewald8-Jun-07 2:38
Dewald8-Jun-07 2:38 
GeneralRe: Packing a class into a byte array - would [Serializable] do the trick? Pin
AikinX8-Jun-07 3:27
AikinX8-Jun-07 3:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.