Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi I am using VS 2010 Express and have ported some code proven in VS 2008 but it fails in VS 2010 and I cannot understand why.
The code uses InvokeMember:
<object>.Interface.GetType().InvokeMember("<Method Name>",
                                System.Reflection.BindingFlags.InvokeMethod,
                                null, <Object>.Interface, new object[] { <params> });

It works fine in VS 2008 but not in VS 2010, exception thrown is "Value does not fall within the expected range." The code and references are identical, the <object> is not null.
Baffled.
Any ideas?
Posted
Updated 2-Feb-11 7:42am
v2

1 solution

Might the causes in this thread[^] be related to your problem?
 
Share this answer
 
Comments
aaawesome 3-Feb-11 4:27am    
Thanks for the reply, but no luck. The code I am using is identical so the issue should have arisen in VS2008 if it was the issue described in the article but this worked fine in VS2008.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900