J'ai un problème étrange avec le déploiement d'une application, qui référence un assembly, écrit en C++ géré.System.IO.FileNotFoundException: Impossible de charger le fichier ou l'assembly 'X' ou l'une de ses dépendances lors du déploiement de l'application
J'ai créé un assemblage X, l'ai compilé et référencé dans un fichier exe, appelé Starter. Starter.exe démarre normalement sur la machine locale. Cependant, quand je copier tout le contenu du dossier de débogage de démarrage à un mashine virtuel, et essayez de démarrer là, il se bloque à l'exception suivante:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'X' or one of its dependencies. The specified module could not be found.
Cela ne fait pas de sens pour moi, parce que X est juste dans le même dossier que Starter.exe.
Qu'est-ce qui pourrait causer ce problème?
MISE À JOUR
Je l'ai examiné les dépendances dans le réflecteur sur la machine cible, et il a été en mesure de trouver des fichiers pour tous ceux.
J'ai également changé les configurations en x86/win32 pour tous les projets.
MISE À JOUR
Voici les journaux de Fusion Log (emplacement: C: \ FusionLog \ Default \ Starter.exe \ X, Version = 1.0.4538.22813, Culture = neutral, PublicKeyToken = null.HTM) :
*** Assembly Binder Log Entry (6/4/2012 @ 1:56:13 PM) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Documents and Settings\Administrator\Desktop\tmp\k;k\Starter.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = MENKAUR-7683827\Administrator
LOG: DisplayName = X, Version=1.0.4538.22813, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Documents and Settings/Administrator/Desktop/tmp/k;k/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = Starter.exe
Calling assembly : Starter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Documents and Settings\Administrator\Desktop\tmp\k;k\Starter.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Documents and Settings/Administrator/Desktop/tmp/k;k/X.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Documents and Settings\Administrator\Desktop\tmp\k;k\X.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: X, Version=1.0.4538.22813, Culture=neutral, PublicKeyToken=null
LOG: Binding succeeds. Returns assembly from C:\Documents and Settings\Administrator\Desktop\tmp\k;k\X.dll.
LOG: Assembly is loaded in default load context.
les seules erreurs sont dans C: \ FusionLog \ NativeImage \ Starter.exe répertoire \:
*** Assembly Binder Log Entry (6/4/2012 @ 1:56:13 PM) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Documents and Settings\Administrator\Desktop\tmp\k;k\Starter.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = MENKAUR-7683827\Administrator
LOG: DisplayName = BookmarkWiz.Kernel, Version=1.0.4538.22813, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Documents and Settings/Administrator/Desktop/tmp/k;k/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = Starter.exe
Calling assembly : Starter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: Start binding of native image X, Version=1.0.4538.22813, Culture=neutral, PublicKeyToken=null.
WRN: No matching native image found.
LOG: IL assembly loaded from C:\Documents and Settings\Administrator\Desktop\tmp\k;k\X.dll.
Je ne peux pas signer l'assemblée, comme il fait référence à soi veral autres assemblées, qui ne sont pas signés
Veuillez voir ma réponse mise à jour et vérifiez si vos DLL sont bloquées parce qu'elles proviennent d'une source non fiable. – flayn
Sons comme quelque chose que vous devriez étudier en utilisant le Fusion Log - http://stackoverflow.com/questions/4562859/solving-assembly-not-found-filenotfoundexception-fusion-log –
voir mise à jour ..... –