Running script in VisualStudio 2017 getting error

Ask general questions here.
User avatar
Posts: 374
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Running script in VisualStudio 2017 getting error

Post by Aracknid » Fri Jan 10, 2020 10:38 pm

Using Ranorex 9.2.1. on Windows 10.

I've opened a program I wrote in Visual Studio 2017 and it throws an exception on the first line of Ranorex usage (where you'd get the trial dialog if you didn't have a license, and yes I have a valid license).

The error is: System.ComponentModel.Win32Exception: 'Access is denied'

I've researched this a bit on the web, and most of the examples I've found to resolve this problem don't apply to me. I am running Visual Studio with Administration privileges. I'm not doing anything with web or IIS, nor running on a server. I'm not trying to access a file.

The first Ranorex code I execute (aside from InitResolver(), RanorexInit() ) is to look for a DOM, e.g.:
Dim foo As Ranorex.WebDocument = Nothing
foo = Host.Current.FindSingle("./dom") 'This throws the exception

I'm know this was working with an older version of Ranorex (version 8.x). I updated to 9.1 at one point and also since this is a development system for other types of coding, I've done other coding (not related to Ranorex). I've installed .NET development 4.6.2. It was not working with Ranorex 9.1 so I updated to 9.2.1 and it still doesn't work.

Any thoughts?



User avatar
Certified Professional
Certified Professional
Posts: 222
Joined: Mon Jul 11, 2016 2:15 pm

Re: Running script in VisualStudio 2017 getting error

Post by Vega » Mon Jan 13, 2020 11:18 pm

Very strange for sure; are you able to post the full exception by chance? Does this specifically happen on the line #1 or #2 within the code sample you provided?

Also you mentioned this occurs in an existing project, what happens when you create a brand new project following the VS integration? Would you be able to share a very minimalist sample project which reproduces the issue for you? ... tegration/