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

Trying to read a property value (from a loaded Assembly/Plugin)

P: 2
Hello 2 all,

I have the following problem in finding the property value from the loaded assembly (control).

I am the following setup:

Language: C#
OS: WinXP
MVS 2005/2008
.NET 2.0 - 3.5

Written a base class called "baseOne" (on a separate Assembly), inside this I have a string property "myValue" (with get & set)

Written another class called "formOne" (on a separate Assembly) by referring to the "baseOne" class. On this formOne, have placed a listbox and on click of an item on the listbox, am trying to assign the selected value into the Property "myValue"

So far no issues.

On the main application, along with code for the form creation, have code to handle the form "Clicked" method.

Inside this click method, I have the following code:

Type senderType = sender.GetType();
PropertyInfo idInfo = senderType.GetProperty("myValue");
string id = String.Empty;
if (idInfo != null)
id = idInfo.GetValue(sender, null).ToString();

-- issue --
MessageBox.Show(id); //resulting blank

I tried to debug through the code, the property "myValue" value been retrieved from "baseOne" and not from the "formOne"!

Anyone? Would appreciate help on the issue...

*Hope it is not confusing, if so, would re-do the post
Apr 7 '08 #1
Share this Question
Share on Google+
1 Reply


P: 2
xsd
I have found out the problem/issue, myself.

My bad, I had two assembly files in two locations and all along, it was referred to the bad location. Once I have found the duplicate issue, and ran the main app. the result was flowing smoothly. - no issues.

Thanks for looking in.
(this is one of the good place for giving and taking answers)
Apr 9 '08 #2

Post your reply

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