Exception when setting Compatibility level in code

Bug reports.
User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Exception when setting Compatibility level in code

Post by Ciege » Tue Apr 05, 2011 10:33 pm

When I try to set the compatibility level in code using this:

Code: Select all

Ranorex.Plugin.MsaaFlavor.Instance.FilterCompatibiltyLevel = Ranorex.Plugin.MsaaFlavor.CompatibilityLevel.V2X;
I get this Exception:

Code: Select all

Ranorex.Core.RanorexCoreException was unhandled
  Message="Configuration value 'plugins.msaa.FilterCompatibilityLevel' does not exist."
  Source="Ranorex.Core"
  StackTrace:
       at Ranorex.Core.Configuration.set_Item(String name, Object value)
       at Ranorex.Plugin.MsaaFlavor.set_FilterCompatibiltyLevel(CompatibilityLevel value)
       at ScratchPad.Program.Main(String[] args) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\ScratchPad\ScratchPad\Program.cs:line 20
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Exception when setting Compatibility level in code

Post by Support Team » Wed Apr 06, 2011 11:14 am

Thank you for reporting this bug. It has already been fixed for the next service release 3.0.2.

The exception is only thrown if the plugins are not yet loaded when getting/setting this property (which is automatically done when the element tree is first accessed, i.e. on the first search). Please, either set this property using the Ranorex Plug-in specific settings (recommended) or, as a workaround, make sure that the plugins are loaded before setting the property:
Ranorex.Core.PluginManager.Instance.LoadDefaultPlugins();
Regards,
Alex
Ranorex Team
.
Image

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Exception when setting Compatibility level in code

Post by Ciege » Wed Apr 06, 2011 3:50 pm

OK, thanks...

Can you also tell me what the proper code is for turning the Basic Delphi Support to false? I cannot seem to find it. I'd rather do it in code since on my runtime license I cannot launch Spy and change it in the Plugins tab. I also don't want to worry about making sure I remember to make the setting anytime I may use a new machine or reset a VMWare image to base.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Exception when setting Compatibility level in code

Post by Support Team » Wed Apr 06, 2011 4:33 pm

Ciege wrote:Can you also tell me what the proper code is for turning the Basic Delphi Support to false?
Ranorex.Plugin.Win32Flavor.Instance.EnableBasicDelphiSupport = false;
Again, the plugins need to be already loaded when calling this property.

Regards,
Alex
Ranorex Team
.
Image

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Exception when setting Compatibility level in code

Post by Ciege » Wed Apr 06, 2011 6:00 pm

This does not work for me.

Code: Select all

Ranorex.Plugin.Win32Flavor.Instance.EnableBasicDelphiSupport = false;   
I get this error when I try to compile:

Code: Select all

The type or namespace name 'Win32Flavor' does not exist in the namespace 'Ranorex.Plugin' (are you missing an assembly reference?)	
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Exception when setting Compatibility level in code

Post by Ciege » Wed Apr 06, 2011 6:02 pm

Ah, never mind. I have never had a reference to the Win32 plugin in my code before thus the error. I made the reference and the code compiled fine.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...