.NET 4. Could not load file or assembly 'x' or one of its dependencies. The specified module could not be found

Kilitli .NET 4. Could not load file or assembly 'x' or one of its dependencies. The specified module could not be found

  • 26 Şubat 2012 Pazar 04:46
     
     

    I have a C# WPF application built in VS 2010 with Target Platform set to x86. This exe calls on a Managed DLL with target platform ANYCPU.  The Managed DLL has a reference to a C++ DLL which is compiled with Common Language Runtime Support (/clr) option.

    On .NET 3.5 the app works perfectly with on any OS. It works fine on Win 7 as well, on both 32bit and 64 bit.

    Now that I have converted the application and its DLLs to target .NET 4. If it is run on a .NET less than 4, it throws an error that .NET 4 is required which is the expected result.

    The converted app works fine on my development system and on any system that has .NET 4 + .NET 3.5. So far so good!

    However, on systems with ONLY .NET 4 (ie Win 8) or win 7 without .NET 3.5, I get the error: Could not load file or assembly 'x' or one of its dependencies. The specified module could not be found.

    'x' is the C++ dll compiled with Language Runtime Support (/clr) option.

    So, in short the problem only happens on systems with .NET 4 only.

    Any advice would be appreciated. Thank you, - Kam


    Intel Engineer

Tüm Yanıtlar

  • 28 Şubat 2012 Salı 16:34
     
     

    Hi Kam,

    I think your some assembly remain in 3.5 Framework.

    that's why it's work in your development PC and not work in Client PC because there is no framework 3.5 

    So first of all check which DLL is in .net framework 3.5 and convert it into 4.0

    Regards

    Fazal