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:
System.Reflection.BindingFlags.InvokeMethod,
null,
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
Baffled.
Any ideas?
Sam HobbsPosted Feb 8, 2011, 11:29 AM
Andy WebsterPosted Feb 8, 2011, 6:56 AM
Sam HobbsPosted Feb 4, 2011, 8:05 PM
The thing you need to do is to determine what value it is that it is complaining about, but I have no idea how to do that. You still have not made clear what the difference is between the two projects; I assume you have two separate projects for each of VS 2008 and VS 2010. There are other details that would also help that are not provided here.
Andy WebsterPosted Feb 4, 2011, 2:39 PM
Sam HobbsPosted Feb 4, 2011, 1:06 PM
Look in the project properties to find the bit configuarion setting; I forget what it is called. What is it? If it is not 32-bit then you probably just need to change it to 32-bit (I think it is called x86).
Andy WebsterPosted Feb 4, 2011, 11:23 AM
Regards
Andy
Sam HobbsPosted Feb 3, 2011, 12:42 PM
You say that it worked when you were using VS 2008 but not VS 2010 and you assume there is a difference in VS that causes the problem. That is possible but unlikely. My guess is that there is something else that is different and you are assuming there is not. Suthish suggested the possibility that the bit configuration might be different. If there is anything else that is different, then we don't have the information needed to help you.
When I said that you "need to use VS to write an application" I was just responding to the question as it was written. You said it works in VS and I said you need to execute it in an application.
Suthish NairPosted Feb 3, 2011, 5:14 AM
Am not sure, refer forum. Saying by the bit configuration of project might helps.
Or setting a null value to the object.
Andy WebsterPosted Feb 3, 2011, 3:52 AM
Sam HobbsPosted Feb 2, 2011, 3:41 PM