InternalsVisibleTo - Public Key Help Required

G

Guest

Hi.
I've strong-named an application using the 'Signing' option in project
properties. Four friend assemblies exist in AssemblyInfo.cs, and look like
this:
[assembly:
InternalsVisibleTo("Microsoft.Practices.EnterpriseLibrary.Logging.Tests")]

After strong-naming the application my friend references are giving the error:
"Friend assembly reference
Microsoft.Practices.EnterpriseLibrary.Logging.Tests is invalid. Strong-name
signed assemblies must specify a public key in their InternalsVisibleTo
declarations."

I understand that I must specify the PublicKey value in the
InternalsVisibleTo declaration. What I DON'T know is how to acquire this.
How to I get the PublicKey value? I've tried running the command "sn -tp
...." from the Visual Studio 2005 Command prompt, but it says it can't find
the file.

How do I get this PublicKey value?

Thanks!
 
M

Markus

How do I get this PublicKey value?

sn -T yourdllname.dll

or

sn -T yourexename.exe


hth
Markus
 
G

Guest

Markus,
The project has not yet been successfully built, and therefore a .dll
doesn't yet exist. How should I proceed in this case?

Thanks for your time.
 
M

Markus

The project has not yet been successfully built, and therefore a .dll
doesn't yet exist. How should I proceed in this case?

Create another project with just on .cs (or .vb) file. Build this and
sign this. Then get the public key from it (it's the same, when signed
with the same key).

Additionally, you might also get the public key from the .snk File. Just
go into the command line and type "sn". Then all the options for sn are
displayed and check for the right flag.

Markus
 
G

Guest

Got it! Thank you!!

Markus said:
Create another project with just on .cs (or .vb) file. Build this and
sign this. Then get the public key from it (it's the same, when signed
with the same key).

Additionally, you might also get the public key from the .snk File. Just
go into the command line and type "sn". Then all the options for sn are
displayed and check for the right flag.

Markus
 

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