Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Strong naming problem

Reply
Thread Tools

Strong naming problem

 
 
Larry Smith
Guest
Posts: n/a
 
      12-24-2008
Hi there,

I'm trying to publish my web site from VS by right-clicking the project and
selecting "Publish Web Site". On the dialog that appears, I then check
"Enable strong naming on precompiled assemblies" and enter the name of my
".pfx" file in the "Key file location" field. The following error results
however when I proceed with publishing:

"Error 5 Cryptographic failure while signing assembly 'c:\Documents and
Settings\Developer1\Local Settings\Temp\Temporary ASP.NET
Files\publish\8cf0e763\82cfb5f8\App_Web_boczeoov.d ll' -- 'Bad Version of
provider. ' "

Note that my ".pfx" file was issued by a well-known certificate authority
and works everywhere else I use it in VS (or otherwise). I tried using a
".snk" file above instead (after converting my ".pfx" to a ".snk" file using
"sn.exe") but that results in:

"Error 5 Cryptographic failure while signing assembly 'c:\Documents and
Settings\Developer1\Local Settings\Temp\Temporary ASP.NET
Files\publish\8cf0e763\82cfb5f8\App_Web_5cvwn6lo.d ll' -- 'Key file
'c:\MyProject.snk' is missing the private key needed for signing' "

I also tried doing all this from the command line outside of VS (using
"aspnet_compiler.exe") but the problem persists. Can anyone shed any light
as I've already Googled extensively with no luck. Thanks.


 
Reply With Quote
 
 
 
 
Gaurav Vaish \(a.k.a. MasterGaurav\)
Guest
Posts: n/a
 
      12-26-2008
Hi Larry,

> I'm trying to publish my web site from VS by right-clicking the project
> and selecting "Publish Web Site". On the dialog that appears, I then check
> "Enable strong naming on precompiled assemblies" and enter the name of my
> ".pfx" file in the "Key file location" field. The following error results
> however when I proceed with publishing:


pfx file is not for "strong-naming" the assemblies. It's for
digitally-sigining any module (exe, dll or otherwise).

The snk file (created from sn) will be used to sign the assembly.

:
: "Error 5 Cryptographic failure while signing assembly 'c:\Documents and
: Settings\Developer1\Local Settings\Temp\Temporary ASP.NET
: Files\publish\8cf0e763\82cfb5f8\App_Web_5cvwn6lo.d ll' -- 'Key file
: 'c:\MyProject.snk' is missing the private key needed for signing' "

I think MyProject.snk contains only the public key.
Just tryout the following at command line (create a dummy class
HelloWorld.cs):

C:\>csc /keyfile:MyProject.snk /out:HelloWorld.dll /t:library HelloWorld.cs

If you get the error, it's time to regenerate the key (sn -k).


--
Happy Hacking,
Gaurav Vaish
http://blogs.mastergaurav.com
http://eduzine.edujini-labs.com
---------------------------




 
Reply With Quote
 
 
 
 
Larry Smith
Guest
Posts: n/a
 
      12-28-2008
> pfx file is not for "strong-naming" the assemblies. It's for
> digitally-sigining any module (exe, dll or otherwise).


Thanks but I don't think that's entirely correct. You should be able to use
either AFAIK. In fact, you can use a ".snk" or ".pfx" file to sign
assemblies in VS and ".pfx" files are normally recommended because they're
password protected (unlike ".snk" files). This doesn't work for precompiled
website assemblies however (as noted in my first post) and I don't know why.
The same ".pfx" file works for all other assemblies.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: "Strong typing vs. strong testing" namekuseijin Python 229 10-29-2010 09:02 AM
Re: "Strong typing vs. strong testing" namekuseijin C Programming 214 10-17-2010 01:12 PM
Strong naming problem Larry Smith ASP .Net Security 2 12-28-2008 12:46 PM
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
Compilation fails when a windows form user control is assigned a strong name but it refers to an activex control which does not have strong name ashish_gokhale ASP .Net Web Controls 0 05-05-2005 01:38 PM



Advertisments