Click here to Skip to main content
16,008,175 members
Home / Discussions / C#
   

C#

 
GeneralRe: Save project Pin
sreejith ss nair16-Sep-04 17:29
sreejith ss nair16-Sep-04 17:29 
GeneralRe: Save project Pin
ee9903517-Sep-04 0:05
ee9903517-Sep-04 0:05 
GeneralReflection problem Pin
Ananth RK16-Sep-04 3:47
Ananth RK16-Sep-04 3:47 
GeneralRe: Reflection problem Pin
leppie16-Sep-04 3:53
leppie16-Sep-04 3:53 
GeneralRe: Reflection problem Pin
Ananth RK16-Sep-04 4:24
Ananth RK16-Sep-04 4:24 
GeneralRe: Reflection problem Pin
Heath Stewart16-Sep-04 6:34
protectorHeath Stewart16-Sep-04 6:34 
GeneralRe: Reflection problem Pin
Ananth RK16-Sep-04 8:05
Ananth RK16-Sep-04 8:05 
GeneralRe: Reflection problem Pin
Heath Stewart16-Sep-04 9:24
protectorHeath Stewart16-Sep-04 9:24 
AnanthRK wrote:
FYI, the OS is Windows2003..could it have any effect?

No, not on a (mostly) platform-dependent framework. Besides, reflection is platform-independent.

I see several problems with your original code. First, why do you get a second MethodInfo by name when you already have a MethodInfo (the current one you're looping through in your foreach)? You never do check for null in cases where you should (making sure you get a MethodInfo for a named method, for example).

Also keep in mind that Type.GetMethods() - with no parameters - gets only public instance methods defined on that Type.

Finally, change your catch and get the whole exception, not some friendly error message. These are much more helpful when debugging. A TargetInvocationException can happen for many reasons. Knowing the exact reason (the Message and InnerException properties, if the latter is assigned) will be greatly more helpful.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles]
Generalabout xml: Pin
skywen16-Sep-04 3:41
skywen16-Sep-04 3:41 
GeneralRe: about xml: Pin
Heath Stewart16-Sep-04 6:26
protectorHeath Stewart16-Sep-04 6:26 
GeneralAuthority problem, I guess... Pin
mcgahanfl16-Sep-04 2:40
mcgahanfl16-Sep-04 2:40 
GeneralRe: Authority problem, I guess... Pin
Stefan Troschuetz16-Sep-04 3:40
Stefan Troschuetz16-Sep-04 3:40 
GeneralRe: Authority problem, I guess... Pin
leppie16-Sep-04 3:41
leppie16-Sep-04 3:41 
GeneralRe: Authority problem, I guess... Pin
Steven Campbell16-Sep-04 6:22
Steven Campbell16-Sep-04 6:22 
GeneralRe: Authority problem, I guess... Pin
Heath Stewart16-Sep-04 6:37
protectorHeath Stewart16-Sep-04 6:37 
GeneralRe: Authority problem, I guess... Pin
Heath Stewart16-Sep-04 6:57
protectorHeath Stewart16-Sep-04 6:57 
GeneralSimple Problem with listview Pin
brunoconde16-Sep-04 2:20
brunoconde16-Sep-04 2:20 
GeneralRe: Simple Problem with listview Pin
sreejith ss nair16-Sep-04 2:39
sreejith ss nair16-Sep-04 2:39 
GeneralDatagrid form steals focus Pin
the last free name16-Sep-04 1:45
the last free name16-Sep-04 1:45 
GeneralRe: Datagrid form steals focus Pin
sreejith ss nair16-Sep-04 2:31
sreejith ss nair16-Sep-04 2:31 
GeneralRe: Datagrid form steals focus Pin
the last free name16-Sep-04 3:33
the last free name16-Sep-04 3:33 
Questionhow to write debug code for nt service(c#) Pin
williamchou16-Sep-04 1:29
williamchou16-Sep-04 1:29 
AnswerRe: how to write debug code for nt service(c#) Pin
mav.northwind16-Sep-04 3:07
mav.northwind16-Sep-04 3:07 
Generaldelete datagird row Pin
Daminda16-Sep-04 1:20
Daminda16-Sep-04 1:20 
GeneralRe: delete datagird row Pin
sreejith ss nair16-Sep-04 2:28
sreejith ss nair16-Sep-04 2:28 

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.