On 3/11/2011 9:27 AM, Kevin Burton wrote:
> Along these same lines I tried building the CA project setting the target as 
> x64 just to see if this made a difference. I did get a different error 
> message but it still didn't work:
>
> MSI (s) (60:80) [08:07:23:231]: Created Custom Action Server with PID 5428 
> (0x1534).
> MSI (s) (60:C0) [08:07:23:278]: Running as a service.
> MSI (s) (60:C0) [08:07:23:278]: Hello, I'm your 32bit Impersonated custom 
> action server.
> Action start 8:07:23: CA_CheckCredentials.
> SFXCA: Extracting custom action to temporary directory: 
> D:\WINDOWS\Installer\MSI463.tmp-\
> SFXCA: Binding to CLR version v4.0.30319
> Calling custom action 
> BrainCustomActions!BuySeasons.BsiServices.Install.CustomActions.CheckCredentials
> Error: could not load custom action class 
> BuySeasons.BsiServices.Install.CustomActions from assembly: BrainCustomActions
> System.BadImageFormatException: Could not load file or assembly 
> 'BrainCustomActions' or one of its dependencies. An attempt was made to load 
> a program with an incorrect format.
> File name: 'BrainCustomActions'
>     at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String 
> codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, 
> StackCrawlMark&  stackMark, Boolean throwOnFileNotFound, Boolean 
> forIntrospection, Boolean suppressSecurityChecks)
>     at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String 
> codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, 
> StackCrawlMark&  stackMark, Boolean throwOnFileNotFound, Boolean 
> forIntrospection, Boolean suppressSecurityChecks)
>     at 
> System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName 
> assemblyRef, Evidence assemblySecurity, StackCrawlMark&  stackMark, Boolean 
> forIntrospection, Boolean suppressSecurityChecks)
>     at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, 
> Evidence assemblySecurity, StackCrawlMark&  stackMark, Boolean 
> forIntrospection)
>     at System.AppDomain.Load(String assemblyString)
>     at 
> Microsoft.Deployment.WindowsInstaller.CustomActionProxy.GetCustomActionMethod(Session
>  session, String assemblyName, String className, String methodName)
>

This error is because you are trying to load the x64 
assembly into an x86 runtime environment. Note the line 
immediately before your custom action is called:

"Hello, I'm your 32bit Impersonated custom action server."

That's coming from MSI and is telling you that MSI's running 
in 32-bit mode already. Remember, the MSI itself is already 
targeting a specific architecture, as specified by the 
Platform attribute on your Package tag. Your MSI is a 32-bit 
MSI, so everything it loads needs to be 32-bit as well.

Ideally you should be building two separate packages, one 
for each arch. By setting up your Solution build 
configurations properly this is pretty simple, and will 
build a 64-bit MSI with a 64-bit CA project, and 32-bit MSI 
with a 32-bit CA project. The key here is that WiX defines a 
Platform variable that matches the platform for the 
currently building configuration, so you would do things like:

<Package ... Platform="$(var.Platform)" />

For more details on the MSI side of things, see:

http://blogs.msdn.com/b/heaths/archive/2008/01/15/different-packages-are-required-for-different-processor-architectures.aspx

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to