Strong Name Signing problem

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, melvyn.harbour, dom.smith

Strong Name Signing problem

Postby eric-914 » Mon Dec 03, 2012 8:51 pm

I am having difficulty w/ this option, so I decided to start a brand new project from scratch to see if I could get it to work/fail.

1) I started a new VS2010 (C#) WPF project, called it SmartAssemblyTesting
2) I built this project in Release mode
3) I started a new SmartAssembly project, pointing the source to my .exe to the Release folder of my VS project.
4) I then pointed the destination to a different folder.
5) Now the only option I activated in S/A is the Strong Name Signing. I point it to a .PFX file, and enter the password.
6) All good so far, so I hit Build
7) I ran the .exe in the destination folder. Fail.
8 ) I rebuilt the S/A project w/ Self-Diagnostics
9) I re-ran the .exe in the destination folder. Fail.

It shows this message:
System.IO.FileLoadException: Could not load file or assembly 'SmartAssemblyTesting, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

There are no external dependencies (that are not defined in the GAC) for this project.

What am I doing wrong?
eric-914
 
Posts: 28
Joined: Fri Nov 30, 2012 5:51 pm

Postby DanielRose » Tue Dec 04, 2012 9:23 am

Is the original project output strong-name signed?
DanielRose
 
Posts: 16
Joined: Fri Oct 30, 2009 9:29 am
Location: Aachen, Germany

Postby eric-914 » Tue Dec 04, 2012 4:16 pm

In my "real" project, the original output is strong-named signed, yes. In the "test" project, no.

I'm using the same .PFX file for all three cases. (Original signed + post-signed for the "real", post-signed for the "test")
eric-914
 
Posts: 28
Joined: Fri Nov 30, 2012 5:51 pm

Postby eric-914 » Fri Dec 07, 2012 9:24 pm

Well, I have an update. I started a brand new project (again) for more experimenting. This time however, I checked the project property Signing >> [X] Sign the assembly, and pointed it to the PFX file.

This time the project worked. Uncheck the option and it breaks again.

Seems S/A should warn against this situation, but at least I have something to focus on now on my "real" project.
eric-914
 
Posts: 28
Joined: Fri Nov 30, 2012 5:51 pm

Fixed

Postby eric-914 » Fri Dec 07, 2012 10:34 pm

It turns out that checkbox is important for S/A to work properly. I remember now I had turned that option off because I have a 3rd party .dll that wasn't signed, so I couldn't check it.

Fortunately, great article here shows how to fix that problem:
Signing an Unsigned Assembly
http://buffered.io/posts/net-fu-signing ... y-signing/

Now, w/ all .dlls signed, I could check the box, sign the assembly, and run S/A, and run the program.
eric-914
 
Posts: 28
Joined: Fri Nov 30, 2012 5:51 pm


Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 1 guest