000023077 - Using Crypto-C ME with Visual Studio 2005 SP1

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 22, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000023077
Applies ToRSA BSAFE Crypto-C Micro Edition
RSA BSAFE Crypto-C Micro Edition 2.1 and later
IssueUsing Crypto-C ME with Visual Studio 2005 SP1

Error when running an application built with Visual Studio 2005 SP1 and linking Crypto-C ME:

An application has made an attempt to load the C runtime library incorrectly.  Please contact the application's support team for more information.

CauseCrypto-C ME was built with Visual Studio 2005 and its manifest files (in the lib directory) are requesting C runtime library (CRT) version 8.0.50608.0.  Visual Studio 2005 SP1 uses CRT 8.0.50727.762, so the versions are different.

A workaround is to use .config files.  From http://blogs.msdn.com/nikolad/archive/2007/03/29/a-solution-to-two-references-to-different-versions-of-crt-mfc-atl-in-one-application-manifest-file.aspx:

Usually application manifest would look similar to the following:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">



      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>





      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>




Notice underlined version of assembly. This manifest tells Windows loader to load two different versions of the same assembly. The loader is going to do what it is told to. But the problem arises when it can only find one version (50608) of them.

Workaround#2: If you are redistributing VC++ libraries in application?s local folder, you need to add an application configuration file that redirects an attempt to load 8.0.50608.0 version to 8.0.50727.762 version.  Configuration file has to have same name as the exe plus .config extension and has to be right next to exe or embedded into the EXE. Here is an example of a configuration file that one would use to resolve issue with the manifest from above:



              <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">


        <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

        <bindingRedirect oldVersion="8.0.41204.256-8.0.50727.762" newVersion="8.0.50727.762"/>





This file basically redirects attempts to load any version of VC CRT greater or equal to 8.0.41204.256 (VS2005 Beta 1) and less than 8.0.50727.762(VS2005 SP1) to load VS2005 SP1 version of VC CRT. It is similar to what the policy file does for a case when CRT is installed into WinSxS folder.

NotesProblem does not occur when running Crypto-C ME sample code.
Legacy Article IDa38988