Are you using delay-signing? If so is it possible that mycustom.dll was 
delay-signed without being real-signed.

Strong name signing should work fine for mycustom.dll (but not mycustom.CA.dll 
since that is not a .NET assembly). The tricky thing is you have to make sure 
the managed assembly gets fully signed before being packed up in the .CA.dll. 
This may require some customization of your project's build process, depending 
on how you have integrated signing. Or you can disable strong name signing for 
that assembly, if that is acceptable within your product's policy.

When you say "all binaries are signed" I guess you are referring to 
authenticode signing? That's totally separate from strong name signing and 
definitely unrelated to the error.

-Jason-

-----Original Message-----
From: Lian Jiang [mailto:lji...@microsoft.com] 
Sent: Wednesday, July 22, 2009 8:13 AM
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] strong name for C# custom action project

Hi,

My msi uses custom action from C# custom action project.

As you know, as C# custom action project will generate mycustom.dll and 
mycustom.CA.dll. The former is managed and the later is unmanaged.

In my project, all binaries (including mycustom.dll and mycustom.CA.dll) are 
signed and the msi is not.

When I installed the msi, it threw below exception:

Error: could not load custom action class My.CustomActions from assembly: 
My.CustomAction
System.IO.FileLoadException: Could not load file or assembly 'My.CustomAction, 
Version=1.0.82.0, Culture=neutral, PublicKeyToken=31bb5956ad364e35' or one of 
its dependencies. Strong name validation failed. (Exception from HRESULT: 
0x8013141A)
File name: 'My.CustomAction, Version=1.0.82.0, Culture=neutral, 
PublicKeyToken=31bb5956ad364e35' ---> System.Security.SecurityException: Strong 
name validation failed. (Exception from HRESULT: 0x8013141A)
The Zone of the assembly that failed was:
MyComputer
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, 
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, 
Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, 
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.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)

How can I make my msi work? Should I disable strong name sign for mycustom.dll 
and mycustom.CA.dll?

Appreciate your help.


Thanks
Lian


------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to