sn.exe utility and signing

P

polarz

I'm having problems signing my assembly. When I try to compile my code
I get an error:

The keyset is not defined.

Here is the code from my AssemblyInfo.cs

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("..\\..\\..\\myKey.snk")]

Any suggestions about signing are appreciated, I couldn't find much
info on the web. This is probably overkill for my apps but I'd like to
learn a little about it. Thanks
 
M

Mohamoss

Hi
This should work ok; you need to do nothing other that specifying
the URL of the key file. Try to generate another key pair file (by running
sn.exe with this argument -k c:\key.snk)may be there is something working
with the one you are using. Hope this helps.
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
P

polarz

That is what I did before, I created my own keys and still get the
error.

Cryptographic failure while signing assembly 'C:\Documents and
Settings\Me\My Documents\Visual Studio
Projects\myProject\obj\Release\myProject.exe' -- 'The keyset is not
defined. '

I've created 3 different keys all with the same result. I've also
tried the -i arg and installed a key pair though that still gave the
same error. Any other suggestions are appreciated. Thanks
 
S

Sunny

Hi,
have you tried to put the full path to the key file in AssemblyInfo.cs,
not the relative one?

Sunny
 
P

polarz

I restarted vs, changed nothing, tried to build, and it was
successful. I guess vs needs to be restarted every time a new keypair
is added/created.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top