Red Gate forums :: View topic - Strong Name Signing problem
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Strong Name Signing problem

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
eric-914



Joined: 30 Nov 2012
Posts: 28

PostPosted: Mon Dec 03, 2012 8:51 pm    Post subject: Strong Name Signing problem Reply with quote

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?
Back to top
View user's profile Send private message
DanielRose



Joined: 30 Oct 2009
Posts: 14
Location: Aachen, Germany

PostPosted: Tue Dec 04, 2012 9:23 am    Post subject: Reply with quote

Is the original project output strong-name signed?
Back to top
View user's profile Send private message
eric-914



Joined: 30 Nov 2012
Posts: 28

PostPosted: Tue Dec 04, 2012 4:16 pm    Post subject: Reply with quote

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")
Back to top
View user's profile Send private message
eric-914



Joined: 30 Nov 2012
Posts: 28

PostPosted: Fri Dec 07, 2012 9:24 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
eric-914



Joined: 30 Nov 2012
Posts: 28

PostPosted: Fri Dec 07, 2012 10:34 pm    Post subject: Fixed Reply with quote

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-an-unsigned-assembly-without-delay-signing/

Now, w/ all .dlls signed, I could check the box, sign the assembly, and run S/A, and run the program.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group