Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Setup / January 2005

Tip: Looking for answers? Try searching our database.

Solution with Assembly, Web Site and Setup - How to Sign assembly - check of the signature failed for assembly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DotNetGruven - 17 Jan 2005 23:35 GMT
Hi,

   I've got a solution file with the following projects:
       - MyAssembly.prj
       - MyWebSite.prj
       - MyWebSiteSetUp.prj

Is there a way I can sign the output assembly MyAssembly during a release
build configuration?

Currently, I have a post build event in MyAssembly.prj (see below) which
signs the assembly based upon the configuration.  If a release build, it
uses sn -R with the private key to rewrite the delay signed assembly used
during the debug builds

The problem is, when I deploy to the destination web server, I'm getting:

   check of the signature failed for assembly 'MyAssembly'.

My goal is to have the signing process be part of the Solution, but I have
yet to find a way to pull that off.

Here is what my postbuild script looks like for MyAssembly:
-----------------------------------------------------------------
@echo off

if "$(ConfigurationName)"=="Debug" goto DebugBuildCommands
if "$(ConfigurationName)"=="Release" goto ReleaseBuildCommands

echo Error build must be either build or release
goto DoneExit

:DebugBuildCommands
echo signing debug
sn -Vr "$(TargetPath)"
echo copying $(TargetFileName) to GAC
gacutil /if "$(TargetPath)"
goto DoneExit

:ReleaseBuildCommands
echo signing release
sn -R "$(TargetPath)" c:\MorpheusCommon\BCGICore.snk
echo copying $(TargetFileName) to GAC
gacutil /if "$(TargetPath)"
echo copy "$(TargetFileName)" to
D:\Projects\Morpheus\Web\MGComponentsServer\bin
copy "$(TargetPath)" "D:\Projects\Morpheus\Web\MGComponentsServer\bin"

:DoneExit
exit
==============================================

TIA
geo
Gary Chang[MSFT] - 18 Jan 2005 10:02 GMT
Hi geo,

>If a release build, it uses sn -R with the private key to rewrite the
delay
>signed assembly used during the debug builds
>
>The problem is, when I deploy to the destination web server, I'm getting:
>
>    check of the signature failed for assembly 'MyAssembly'.

At first, I want to make clear If you signed the Release assembly outside
the VS.NET, is it alright?

Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
DotNetGruven - 18 Jan 2005 15:58 GMT
Hy Gary,

   No, I'm trying to automate the process.

   So, signing is taking place as part of the post build events.  WHen the
configuration is Debug, I delay sign.  When release mode, the assemblies are
resigned with sn -R

Thanks
geo

> Hi geo,
>
[quoted text clipped - 20 lines]
> rights.
> --------------------
Gary Chang[MSFT] - 19 Jan 2005 02:36 GMT
Hi geo,

I think the problem is when you use the sn -R to sign an assembly, it needs
that assembly should be signed or delay signed. However in your post build
event's script, the release version's assembly hasn't been signed or delay
signed(since the debug version's assembly has been delay signed, but the
release ver assembly is a differently package from the debug ver one).

So I suggest you can try to modify your script as the following:
..
:ReleaseBuildCommands
echo signing release
sn -Vr "$(TargetPath)"
sn -R "$(TargetPath)" c:\MorpheusCommon\BCGICore.snk
..

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.