2010-10-08 6 views
3

Je dispose d'un fichier dll compilé avec Microsoft .NET Framework 4.0MakeSfxCA.exe et DLL compilé avec Framework 4.0

Quand je suis en utilisant le fichier MakeSfxCA.exe et en passant le dll comme l'un des paramètres de commande en ligne donne me message d'erreur suivant:

 
D:\SetupManager\test>D:\SetupManager\SetupBuilding\Wix\bin\sdk\makesfxca.exe Fil 
e2.dll D:\SetupManager\SetupBuilding\Wix\bin\sdk\x86\sfxCA.dll File1.dll CustomA 
ction.config 
Searching for custom action entry points in File1.dll 
Error: System.BadImageFormatException: Could not load file or assembly 'file:/// 
D:\SetupManager\test\File1.dll' or one of its dependencies. **This assembly is bui 
lt by a runtime newer than the currently loaded runtime and cannot be loaded.** 
File name: 'file:///D:\SetupManager\test\File1.dll' 
    at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, 
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boo 
lean throwOnFileNotFound, Boolean forIntrospection) 
    at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, E 
vidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Bool 
ean throwOnFileNotFound, Boolean forIntrospection) 
    at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence 
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) 
    at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence 
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean 
forIntrospection, StackCrawlMark& stackMark) 
    at System.Reflection.Assembly.ReflectionOnlyLoadFrom(String assemblyFile) 
    at Microsoft.Deployment.Tools.MakeSfxCA.MakeSfxCA.FindEntryPoints(String modu 
le) 
    at Microsoft.Deployment.Tools.MakeSfxCA.MakeSfxCA.Build(String output, String 
sfxdll, IList`1 inputs, TextWriter log) 
    at Microsoft.Deployment.Tools.MakeSfxCA.MakeSfxCA.Main(String[] args) 

=== Pre-bind state information === 
LOG: User = DSDMAIN\Rajesh 
LOG: Where-ref bind. Location = D:\SetupManager\test\File1.dll 
LOG: Appbase = file:///D:/SetupManager/SetupBuilding/Wix/bin/sdk/ 
LOG: Initial PrivatePath = NULL 
Calling assembly : (Unknown). 
=== 
LOG: This is an inspection only bind. 
LOG: No application configuration file found. 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2 
.0.50727\config\machine.config. 
LOG: Attempting download of new URL file:///D:/SetupManager/test/File1.dll. 
ERR: Failed to complete setup of assembly (hr = 0x8013101b). Probing terminated. 

Toute aide est appréciée.

Merci d'avance.

Répondre

2

j'ai eu un problème similaire de travail en ajoutant le code suivant au fichier CustomActions.config et la création d'un fichier MakeSfxCA.exe.config à côté du MakeSfxCA.exe

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <startup useLegacyV2RuntimeActivationPolicy="true"> 
     <supportedRuntime version="v4.0" /> 
    </startup> 
</configuration> 
2

Ma question était légèrement différente, mais cela peut être utile à d'autres personnes. Le fichier .config doit avoir le nom "CustomAction.config" dans votre projet. Il ne peut pas avoir le nom <YourCAProject>.config comme cela se produira lorsque vous renommez le projet pour donner à la DLL un nom unique. Il semble que l'outil de construction MakeSfxCA et le stub SfxCA dépendent de ce nom de fichier pour l'instant.

+0

Cela m'a causé des problèmes aussi; Merci! –

Questions connexes