Meaning of error message

Ask general questions here.
User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Meaning of error message

Post by slavikf » Fri Mar 04, 2011 2:52 am

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);

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Meaning of error message

Post by Support Team » Fri Mar 04, 2011 12:16 pm

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