NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Migration XP->Windows 7 DLL can't be loaded any more

We have a Teststand sequence which uses a Labwindows CVI generated 32bit DLL called sensor.dll for doing its measurements

This works fine under XP using TestStand 4.2.1.  However starting the same sequence using the same sensor.dll  with  TestStand 4.2.1 on windows 7 64bit generates a -17004 error when trying to load that DLL.  During the first try it complained that msvcr90.dll is missing despite the MSVC++2008  runtime is installed in winsxs directory. If I copy  msvcr90.dll into a directory within ( directory search ) PATH, the messages about missing msvcr90.dll disappears, but the DLL still can't be loaded from TestStand ( without any hint to a missing dll) .

 

Looking at sensor.dll with Dependency Walker shows only two missing delay-load dependencies (on XP to IESHIMS.dll and  WER.dll, on Windows 7 to IESHIMS.dll and gpsvc.dll). I couldn't find any 32bit version of gpsvc.dll for windows7 so far, but that shouldn't matter because that's just a delay-load dependency.

The dependency to msvcr90.dll is brought in by another dll, which was build with MSVC++2008 and we checked the Manifest of that DLL and  couldn't find an error. 

The problem also exists with TestStand2012.

Ny questions are now: Why do I need to copy msvcr90.dll from its standard location in winsxs to another location on windows 7 but not on XP ? Any ideas what's going wrong when loading the dll on Windows 7 and how to debug that further ?  

 

0 Kudos
Message 1 of 6
(4,473 Views)

There are a lot more parts to the msvcr90 runtime engine besides that dll. Copying the dll to a directory is not likely to fix the problem, installing a runtime like this is generally too complicated to be handled by simply copying and requires an installer. You need to get the installer from microsoft's website or from your visual studio installation CD.

 

Most likely you have an older version of msvc90 on your machine and not the newer version which your dll requires. You might need to run windows update to ensure you have the latest patch for the runtime. Programs which require a patched version of the runtime will not load if that newer patched version is not on the machine.

 

Hope this helps,

-Doug

0 Kudos
Message 2 of 6
(4,464 Views)

Well, we have the MSVC++2008 SP1 runtime  installed by installer ( into the standard winsxs directory) and then we did run windows update to get the latest updates.

When we try to load sensor.dll at that point, the error message complains about a missing msvcrt90.dll. and looking with process explorer at the sequence editor whe see that it doesn't find msvcr90.dll where it searches ( that doesn't include winsxs) .

Only after that , we copied msvcrt90.dll(  from winsxs, where it was installed) into PATH and the error message changed and didn't complain any more about a missing msvcr90.dll , with processexpolorer you can see, that it now finds the msvcr90.dll. But sensor dll still cannot be loaded.

 

0 Kudos
Message 3 of 6
(4,457 Views)

How can I verify that the matching version for the MSVC++9.0  run time is installed ?

I did look into winsxs/manifest directory and found a manifest file containing.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <noInheritable></noInheritable>
    <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    <file name="msvcr90.dll" hashalg="SHA1" hash="e0dcdcbfcb452747da530fae6b000d47c8674671"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>KSaO8M0iCtPF6YEr79P1dZ...> <file name="msvcp90.dll" hashalg="SHA1" hash="81efe890e4ef2615c0bb4dda7b94bea177c86ebd"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>ojDmTgpYMFRKJYkPcM6ckp...> <file name="msvcm90.dll" hashalg="SHA1" hash="5470081b336abd7b82c6387567a661a729483b04"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>tVogb8kezDre2mXShlIqpp...>
</assembly>

And looking into the dll, which introduces the dependency to msvcr90.dll  that dll includes a embedded manifest section with exactly the same values for name,version,processorArchitecture and publickeyToken.

So it looks for me that there is the matching version of msvc++ runtime installed ( with the installer , not by just copying it)

0 Kudos
Message 4 of 6
(4,449 Views)

How was this dll created? I think CVI does not typically link anything to visual studio's runtime engines. Did you create this .dll in Visual studio? Perhaps there are some incorrect project settings?

 

-Doug

0 Kudos
Message 5 of 6
(4,438 Views)

Well , dependency to the MSVC++ runtime is caused by calls from sensor.dll to another dll, which was created with MSVC++.

And the problem was , that there was an outdated version of that dll was installed on the windows 7 machine so that there were some unresolvable calls into that dll.  So the error message was misleading. It should have complained about that dll and not about the MSVC++ runtime.  

0 Kudos
Message 6 of 6
(4,427 Views)