473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

InternalsVisibleTo - Public Key Help Required

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.Enterprise Library.Logging.Tests")]

After strong-naming the application my friend references are giving the error:
"Friend assembly reference
Microsoft.Practices.EnterpriseLibrary.Logging.Test s 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!
Oct 2 '06 #1
4 8734
How do I get this PublicKey value?

sn -T yourdllname.dll

or

sn -T yourexename.exe
hth
Markus
Oct 2 '06 #2
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.

"Markus" wrote:
How do I get this PublicKey value?

sn -T yourdllname.dll

or

sn -T yourexename.exe
hth
Markus
Oct 2 '06 #3
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
Oct 2 '06 #4
Got it! Thank you!!

"Markus" wrote:
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
Oct 2 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Andrew Schepler | last post by:
When compiled with Visual C++ .NET 2003 (only), the program below aborts as though no matching catch clause is present. If the copy constructor of A is made public, it successfully catches the...
1
by: RSH | last post by:
Hi, I have a situation where I have a Windows Form and I have 2 classes defined in the code, the primary form and a class that I got from the internet. I have a label in the form that I would...
0
by: Andy | last post by:
Hi all, I'm trying to create unit tests in a seperate assembly from the library. However there are some internal classes that deserve testing but are not intended to be used by the public. ...
34
by: Asfand Yar Qazi | last post by:
Hi, I'm creating a library where several classes are intertwined rather tightly. I'm thinking of making them all use pimpls, so that these circular dependancies can be avoided easily, and I'm...
9
by: gzinger | last post by:
I have an assembly with some internal methods that I have to access from my web service. I learned that I can use “InternalsVisibleTo” to enable such access. Since I have control over both the...
0
by: mvanroshum | last post by:
Hi, I have the following problem: The DataSource of a DataGrid can be set to an IList. The DataGrid nicely lists the objects in the IList, showing all the public properties of the objects as...
2
by: fgh.vbn.rty | last post by:
Hi, I'm not sure if i'm asking the question correctly but anyway here it is. Say I have 3 classes - class A, class B, class R. 1) A and B are the building blocks and R is like a repository...
1
by: eshortt84 | last post by:
hey, i'm new to java and i keep getting the return type required error on this line; public dvds(int productNum, String name, int units, double price, String rating) { The code for the whole...
2
by: krishnakrish | last post by:
Hi, My name is krishna. I am using asp.net 2.0 with C#. I amusing Windows XP professional as OS. When I post some data to an external web server I get the error as "The Remote server returned an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.