none
C# Application fails to load mixed mode C++ DLL with "Failed to Start as Configuration is Incorrect Error" (.NET 2.0) RRS feed

  • Question

  • Hi,
    I have a standard Windows forms C# application that uses a mixed mode C++ DLL to access the Windows smart card APIs.
    Everything worked until the updates on July 12th (or there about) to the development system. Since then the application/DLL compiles and runs fine on the development system but fails to run on the production system which a colleague manages.

    The error is "Could not load the assembly xxxx or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (HRESULT: 0x0800736B1)".

    When I compare the systems the update seems to have added new versions of msvcr80.dll and msvcm80.dll into the windows/winSxS subdirectories.
    I have tried placing the DLLs in the appropriate 'program files' directory to see if that helped, but it would appear that they are being forced to load from the winSxS directories (at least according to the dependency walker).

    It seems strange that an update would not be backwards compatible, and I am not sure if that really is the issue.

    Any help would be gratefully appreciated.
    Thanks,
    Keith.
    Monday, August 24, 2009 8:17 PM

Answers

  • Hi Keith

    The problem was that your development environment has a later version of CRT than the product one after "the updates on July 12th (or there about) to the development system".
    As you know, it's hard to make forward-compatibility, but backward-compatibility.

    One short-term workaround can be build the application on an equal or lower version of CRT than end users, but it depends on the backward-compatibility and really hard to guarantee the end users' CRT version.
    As the application already depends on CRT, it's recommended to include a certain version of CRT into the setup as your application's prerequisite considering variety of end users environment.

    For more detailed information of VC++ deployment strategies, please see: http://blogs.msdn.com/aymans/archive/2006/04/04/568466.aspx

    Thanks.

    Figo Fei

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Edited by Figo Fei Wednesday, August 26, 2009 2:58 AM
    • Marked as answer by Figo Fei Monday, September 7, 2009 3:27 AM
    Wednesday, August 26, 2009 2:57 AM

All replies

  • Hi Keith

    Looking at the error HRESULT: 0x0800736B1, "its side-by-side configuration is incorrect" which probably means the CRT version is not correct.
    It's suggested to install the latest vcredist: Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package ATL Security Update , which should fix the problem.

    If it still met the problem, please also check the event log which may include more detailed information.

    Thanks.

    Figo Fei

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com



    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Edited by Figo Fei Tuesday, August 25, 2009 6:49 AM
    Tuesday, August 25, 2009 6:39 AM
  • Hi Figo,
    I am using VS 2005, so I downloaded the 2005 version rather than the 2008 and this fixes the issue.

    Is this update due to be distributed to the rest of the world via Windows Update?
    At a minimum I know it is not present in Windows Update for Windows XP Pro and Windows 2000 Server.

    I do not really wish to have to get all my potential end users to have to install this redistributable package too.
    Thanks,
    Keith.
    Tuesday, August 25, 2009 4:07 PM
  • Hi Keith

    The problem was that your development environment has a later version of CRT than the product one after "the updates on July 12th (or there about) to the development system".
    As you know, it's hard to make forward-compatibility, but backward-compatibility.

    One short-term workaround can be build the application on an equal or lower version of CRT than end users, but it depends on the backward-compatibility and really hard to guarantee the end users' CRT version.
    As the application already depends on CRT, it's recommended to include a certain version of CRT into the setup as your application's prerequisite considering variety of end users environment.

    For more detailed information of VC++ deployment strategies, please see: http://blogs.msdn.com/aymans/archive/2006/04/04/568466.aspx

    Thanks.

    Figo Fei

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Edited by Figo Fei Wednesday, August 26, 2009 2:58 AM
    • Marked as answer by Figo Fei Monday, September 7, 2009 3:27 AM
    Wednesday, August 26, 2009 2:57 AM