View previous topic :: View next topic |
Author |
Message |
Fishtail
Joined: 29 Sep 2011 Posts: 8
|
Posted: Thu Sep 29, 2011 3:26 pm Post subject: Encrypting a mix of signed and unsigned assemblies? |
|
|
We have an executable we'd like to protect with .NET Encryptor. It is unsigned because it references some unsigned third-party interop libraries. It also references some signed third-party components. The pre-build step for our bootstrapper project looks like this:
Code: | NetEncryptor "$(ProjectDir)..\WinForms\$(OutDir)WinForms.exe" outdir:"$(ProjectDir)Assemblies" /strongnamefile:"$(ProjectDir)StrongName.snk"
NetEncryptor "$(ProjectDir)..\WinForms\$(OutDir)log4net.dll" /outdir:"$(ProjectDir)Assemblies" /token:1b44e1d426115821 |
WinForms.exe is our main unsigned executable, StrongName.snk is the same key used to sign the bootstrapper itself, and log4net.dll is a signed assembly and the token shown was extracted with sn.exe. At runtime we get the following exception:
An unhandled exception (Error loading assembly Bootstrap.Assemblies.log4net.enc. Check that the assembly was encrypted using the same strong name parameters used to sign the Entry Assembly) occurred while bootstrapping the application.
Can you tell us what we're doing wrong?
Thanks! |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Sep 29, 2011 10:28 pm Post subject: |
|
|
All the assemblies must be encrypted using the same strong name as is used to sign the bootstrapper. So your pre-build should be:
Code: | NetEncryptor "$(ProjectDir)..\WinForms\$(OutDir)WinForms.exe" /outdir:"$(ProjectDir)Assemblies" /strongnamefile:"$(ProjectDir)StrongName.snk"
NetEncryptor "$(ProjectDir)..\WinForms\$(OutDir)log4net.dll" /outdir:"$(ProjectDir)Assemblies" /strongnamefile:"$(ProjectDir)StrongName.snk |
_________________ Infralution Support |
|
Back to top |
|
|
Fishtail
Joined: 29 Sep 2011 Posts: 8
|
Posted: Fri Sep 30, 2011 9:41 pm Post subject: |
|
|
That fixed it, thanks! |
|
Back to top |
|
|
|