Strong naming problem

Discussion in 'ASP .Net' started by Larry Smith, Dec 24, 2008.

  1. Larry Smith

    Larry Smith Guest

    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.dll' -- '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.dll' -- '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.
     
    Larry Smith, Dec 24, 2008
    #1
    1. Advertising

  2. 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.dll' -- '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
    ---------------------------
     
    Gaurav Vaish \(a.k.a. MasterGaurav\), Dec 26, 2008
    #2
    1. Advertising

  3. Larry Smith

    Larry Smith Guest

    > 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.
     
    Larry Smith, Dec 28, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. C

    Strong Naming

    C, Nov 5, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    419
    Steve C. Orr [MVP, MCSD]
    Nov 6, 2003
  2. Manuel Lopez

    Strong Naming an ASP.Net Project

    Manuel Lopez, Dec 1, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    1,438
    Chris Jackson
    Dec 2, 2003
  3. namekuseijin

    Re: "Strong typing vs. strong testing"

    namekuseijin, Sep 27, 2010, in forum: C Programming
    Replies:
    214
    Views:
    3,469
    Nick Keighley
    Oct 17, 2010
  4. namekuseijin

    Re: "Strong typing vs. strong testing"

    namekuseijin, Sep 27, 2010, in forum: Python
    Replies:
    229
    Views:
    3,566
    Gregory Ewing
    Oct 29, 2010
  5. Larry Smith

    Strong naming problem

    Larry Smith, Dec 24, 2008, in forum: ASP .Net Security
    Replies:
    2
    Views:
    735
    Larry Smith
    Dec 28, 2008
Loading...

Share This Page