Assembly not found? SA deleted it.

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, Alex.Davies, melvyn.harbour

Assembly not found? SA deleted it.

Postby Uniwares_AS » Mon Jun 28, 2010 8:36 pm

Ok, weird problem this one. Never seen that before, but here we go.

During my build process I get the error from SA that it could not find my assembly (which is built using VS2010, SA is invoked as a build task on AfterCompile).
Looking at the obj/Release folder, there is really no assembly, yet it must have been there because of the copy my build step makes before passing it to SA.

"Something" must have deleted it. Using process monitor it shows clearly that its SA processes the file, does actually a lot with it, and then deletes it. Right after it tries to reopen the file and throws the error.

The SA project file settings are identical as all the other projects i my solution which build just fine.

I do have a procmon dump if wanted.
Uniwares_AS
 
Posts: 132
Joined: Thu Oct 11, 2007 3:29 pm

Postby Uniwares_AS » Mon Jun 28, 2010 8:40 pm

PS: building without the SA task and protecting after using the GUI works fine.
Uniwares_AS
 
Posts: 132
Joined: Thu Oct 11, 2007 3:29 pm

Postby Uniwares_AS » Mon Jun 28, 2010 8:59 pm

Solved.

Its a bug in SA. But not in SA 5.0.

The .csproj file was still referencing the build task for SA 4.2 instead of SA 5.0 but the {sa}proj file already contained the updated keyfile password. As it seems, SA 4 does exit without warning before signing the assembly because it cant read the password of the keyfile or something like that.

I tried to repro it here:
* setting the old Password value in the {sa}proj file and building it with the MSBuild task for SA 4.2, works.
* new Password value (as used in SA 5) and building with the task for SA 4.2, deletes the file.
* new password value and build task for SA 5, works too.
Uniwares_AS
 
Posts: 132
Joined: Thu Oct 11, 2007 3:29 pm

Postby Paul.Martin » Tue Jun 29, 2010 12:56 pm

That is a interesting bug, glad you managed to get to the bottom of it.


I presume you are setting output to self.
SmartAssembly will delete the output file if it exists and then write out the new file. The signing is part of the write out step (rather than being a post build step) and as you've found if it can't open the strong name key because of a password decryption failure it will stop, leaving no file.

The failure should return a error code, I'll have a look into it and raise a bug if this is not the case.
Paul.Martin
 
Posts: 83
Joined: Wed Feb 03, 2010 11:20 am
Location: Cambridgeshire


Return to SmartAssembly 5

Who is online

Users browsing this forum: No registered users and 1 guest