Page 1 of 1

Meaning of error message

Posted: Fri Mar 04, 2011 2:52 am
by slavikf
I have project, which worked in Ranorex 2.3.

When i try to run it in Ranorex 3.0 it will not compile.

Here are error messages:

An object reference is required for the non-static field, method, or property 'Review1.Recording1.Element59648_Screenshot6' (CS0120) - C:\AutoRex\Review\Review1\Recording1.UserCode.cs:839,78

An object reference is required for the non-static field, method, or property 'Review1.Recording1.Element59648_Screenshot6_Options' (CS0120) - C:\AutoRex\Review\Review1\Recording1.UserCode.cs:839,104


What's that and how to fix it?

Here is code, where error found:

Code: Select all

			Validate.CompareImage(repo.FormOIS_WinStation_11_EyeSca.Element59648Info, Element59648_Screenshot6, Element59648_Screenshot6_Options, "TC140: Screenshot validation", false);

Re: Meaning of error message

Posted: Fri Mar 04, 2011 12:16 pm
by Support Team
Hi,

This is a breaking change in Ranorex 3.0. Just remove all static keywords in your user code items and you won't get this error again. If you removed all "static's" the solution should compile.

Regards,
Peter
Ranorex Team