C++ runtime libraries loaded incorrectly

Ask general questions here.
Marianne Jacobsen
Posts: 44
Joined: Fri Oct 26, 2007 1:18 pm

C++ runtime libraries loaded incorrectly

Post by Marianne Jacobsen » Wed May 21, 2008 12:46 pm

I have a problem which I do not know whether comes from Ranorex or not. I need a little help.

I'm using the evaluation version 1.4.

By mistake I used the "FindControlName" method instead of accessing the control with "Element.FindChild" method.

By doing this I consistently get an C++ runtime error. By debugging I can see that the error comes from FindControlName call. If I use the Element approach instead I get no error. I'm trying to access a custom .Net control.

I have no C++ code in my project - only C#.

Marianne Jacobsen
Posts: 44
Joined: Fri Oct 26, 2007 1:18 pm

Post by Marianne Jacobsen » Wed May 21, 2008 1:56 pm

On Ranorex 1.2 the error is not present.

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

Post by Support Team » Thu May 22, 2008 8:19 pm

I have no C++ code in my project - only C#.
But RanorexNet.dll needs the unmanaged C++ RanorexCore.dll.
This problem can happen if you use a wrong version of the RanorexCore.dll.
Please check the location and version of the RanorexCore.dll.

Jenö
Ranorex Team

Marianne Jacobsen
Posts: 44
Joined: Fri Oct 26, 2007 1:18 pm

Post by Marianne Jacobsen » Fri May 23, 2008 9:18 am

I've checked the version number of the ranorexcore.dll file and it says 1.4.0.5 and the file resides in the same directory as my executable.

Can this problem be because I'm trying to test an application which has been compiled with Visual Studio 2008?

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

Post by Support Team » Fri May 23, 2008 10:09 am

FindControlName() uses RanorexSpy.dll which depends on the CRT 8.0 runtime.

Please try to install the VC++ Runtime 8.0 SP1 Redist Package

http://www.microsoft.com/downloads/deta ... 9c36f85647

Michael
Ranorex Team

Marianne Jacobsen
Posts: 44
Joined: Fri Oct 26, 2007 1:18 pm

Post by Marianne Jacobsen » Wed May 28, 2008 8:43 am

I've checked all of the dll's and they are the correct version. The application I'm testing has been compiled with Visual Studio 2008 and uses both the 2005 and the 2008 C++ runtime. I've installed both runtimes and the service packs - error is still present.

If I look up the R6034 errorcode on MSDN it says something about a missing manifest file - but how can I know which application is missing the manifest? Would that be the application being tested, my executable or ranorex?

As far as I understand Windows should be able to handle side-by-side sharing of assemblies without much trouble.

Application under test (new version - VS2008 compiled) + Ranorex 1.2 = works
Application under test (old version - VS2005 compiled) + Ranorex 1.2 = works
Application under test (old version - VS2005 compiled) + Ranorex 1.4 = works
Application under test (new version - VS2008 compiled) + Ranorex 1.4 = error

The error might be in my code or test application but how can I identify this and correct it?

Thank your for you help.

Marianne Jacobsen
Posts: 44
Joined: Fri Oct 26, 2007 1:18 pm

Post by Marianne Jacobsen » Wed May 28, 2008 11:23 am

I've figured out that I get the error by just spying on the controls (with RanorexSpyPro) in the application under test. Which means that the error must be in either Ranorex or my application under test.

I've tested on several different machines and the error persists.


Edit: I've examined the matter further and it seems that the error also comes if I use the RanorexSpy 1.2 - which tells me that it's my application under test that causes the failure.

Thank you for your time

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

Post by Support Team » Wed May 28, 2008 2:11 pm

Application under test (new version - VS2008 compiled) + Ranorex 1.4 = error
Does the error happen only if you compile the application with VS2008 and you use the function FindControlName?

Is this correct?

What happens if you compile with VS2008 but you do not use the function FindControlName?

Jenö

Ranorex Team

Marianne Jacobsen
Posts: 44
Joined: Fri Oct 26, 2007 1:18 pm

Post by Marianne Jacobsen » Wed May 28, 2008 3:06 pm

It does fail consistently with the FindControlName method but I've seen it fail also when I'm not using FindControlName (eg. Form.Element.FindChild).

I will try to get the developers of the test application to compile a VS2005 version which is exactly the same as the one compiled in VS2008 - just to see if the error really has something to do with Visual Studio 2008.

Marianne Jacobsen
Posts: 44
Joined: Fri Oct 26, 2007 1:18 pm

Post by Marianne Jacobsen » Fri May 30, 2008 1:10 pm

I've solved the problem with the C++ 2008 runtime.

It was the manifest that caused the problem. I made a manifest for RanorexCore.dll, RanorexSpy.dll and one for my own application. Using these manifests I no longer get the error.

The manifests all look like this:

Code: Select all

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC90.MFC' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*' />
    </dependentAssembly>
  </dependency>

  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC80.MFC" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>
Anybody else who has problems with testing an application build under Visual Studio 2008 may have luck using this manifest.

Thank you for your time.