Sharing Code

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
Jon said:
I'm not in the habit of saying something is broken when it's not.

Didn't say you were. You seem to assume I don't know how VS works with
key files, yet I'm the one who has been signing all of his assemblies
for seven years now.
Try
the following in VS2005:

1) Create a new project in one directory, e.g. c:\TestProject
2) Create a new key in a different directory, e.g. c:\TestKey
3) Go to the Signing tab of the properties view of the project, tick
"Sign the assembly" and then browse to the key
4) Now look in c:\TestProject - you'll find it's copied the key.

I didn't want it to copy the key, I wanted it to use the location I
browsed to. Otherwise each project has it's own key file, which isn't
what I want.

So, what am I doing wrong with VS?

This is the designed bahavior of VS'05. If you don't want it to copy the
file like that (and this is nothing specific to the key file, all the
files work this way in VS) then you first must make a link to your key
file from within your project. Right-click the project name and select
Add, Existing Item. In the Add Item dialog, browse to the key file,
highlight it, then click the little down arrow in the Add button and
select Add As Link. Notice the newly linked-to file shows up in your
project's root and has a little shortcut icon on it to indicate it is a
link to the original file (it does NOT move the file). You can now
drag-and-drop the file to another folder in your project if you want (I
like to keep them in the Properties folder). *Now* you go to the signing
tab, check Sign the assembly, select the drop-down, and you'll see your
file listed in its original location.

This takes a matter of seconds, is done once per project, and to
continue to insist this is some sort of maintenance issue is completely
misleading readers of this thread.
I've run into the problem where a production assembly being signed
means that a unit test assembly needs to be signed too, if you want to
use InternalsVisibleTo.

I can't reproduce that.

I created three projects:

- A class library called ProductionAssembly
- A class library called RefelctingAssembly
- A console app called SignTest

The ProductionAssembly has no references (except the standard System
ones). The ReflectingAssembly project has a reference to the
ProductionAssembly project. The SignTest project references both the
ProductionAssembly and ReflectingAssembly projects.

ProductionAssembly has a public class called ClassWithAttribute and a
private class called APrivateClass. The assembly is marked with the
InternalsVisibleToAttribute attribute.

ReflectingAssembly has a class called Reflect which does this:

Assembly a = Assembly.LoadFrom("ProductionAssembly.dll");
string fullName = a.FullName;
MethodInfo entry = a.EntryPoint;
object i = a.CreateInstance("APrivateClass");
Type[] types = a.GetExportedTypes();
foreach (Type type in types)
{
Console.WriteLine(type.FullName);
}

None of the projects are signed. Like you pointed out, when I run this
it displays just what I would expect, even though ProductionAssembly is
not signed as the docs seem to indicate it should be.

It is pretty cool that I can also do this in the ReflectingClass project:

object x = new

and IntelliSense shows me the APrivateClass class. If I comment-out the
attribute and/or change the name of the assembly the attribute refers to
then the private class no longer appears in IntelliSense. Pretty cool;
gotta love the VS IDE!

If I sign the ProductionAssembly project and try to compile I get this
error:

Friend assembly reference 'ReflectingAssembly' is invalid. Strong-name
signed assemblies must specify a public key in their InternalsVisibleTo
declarations.

This is completely expected to me because I think this is what the docs
are trying to say: If the assembly containing the attribute is not
signed then it does not need to specify a fully-qualified assembly name
as a parameter to the attribute; if the assembly containing the
attribute is signed then it must specify a fully-qualified assembly name
as a parameter to the attribute.

OK, so I sign the ReflectingAssembly project. Same error as above. As
expected, so I change the attribute parameter from the simple assemble
name "ReflectingAssembly" to this:

[assembly: InternalsVisibleTo("ReflectingAssembly,PublicKey=" +
"002400000480000094000000060200000024000052534131000400000100010059f705c061994e"
+
"5cea0cdb921f714a24deed23ed478364605e436bcde9358d6005294e8b72efc9e86794eb88edd3"
+
"4ca41276ee2b1acd2f81025f059bdea806c6f25237da27573f7eb0abe4c9adde97a694596c9b76"
+
"2213fe0a7cd6d5455edb3262eaf6c69e6ebab4d270ad23bde09a4b1c4419bf3f777da98c2c7935"
+
"392d18f2")]

Now the console app runs just fine again.




So yes, if you have a unit test assembly and it references an assembly
that uses InternalsVisibleTo and the referenced assembly is also signed
then the unit test assembly must also be signed. But that's the whole
intent of how the InternalsVisibleTo attribute. The private members of
an unsigned assembly can be accessed via a friend assembly that is
either signed or unsigned; however, the private members of a signed
assemble cannot be accessed by a friend assembly unless the friend
assembly is also signed.

I can see how the docs can be misleading on this one, perhaps even
downright incorrect.
As I said, the documentation is completely broken. You can either sign
both assemblies, or sign neither of them - but you can't just sign the
production assembly.

Yes, but only in the case of using that attribute. If you are not using
that attribute then the test (or any other assembly) that references a
signed assembly does not itself need to signed.
If you have to sign the unit test assembly, that means you then have to
make sure that everything you reference from the unit test assembly
also has to be signed - including any third party assemnblies etc. The
viral nature of signing strikes again.

Is your point that unit test assemblies require the usage of the
InternalsVisibleTo attribute or something? If so, that's not the case.
You are talking about a fringe case: friend assemblies. Perhaps you use
those a lot; I'm not aware of anyone who does, however.

But even if you were to use InternalsVisibleTo in all your production
assemblies (a strange thing to do, it seems to me) then signing your
unit test assembly is no big deal because it will use precisely the same
assemblies you've already built the production assembly with. Again, no
problem at all.
I really don't want to have to sign third party software - and if I
only have the binaries, it's pretty difficult to do so...

I don't like having to sign third-party assemblies either, but have done
it a few times. It is incredibly simple to do. Disassemble to IL, add
one directive to the top of the file, reassemble the IL. Done. And it
only needs to be done *once*.

I have scripts that do this for me for the rare case a third-party does
not and/or will not sign their assembly. I have not seen this in a long
time. Back in the day (2000-2003 or so) I used assemblies from certain
third-party vendors who didn't understand signing and didn't sign their
assemblies. So I made my own version of their DLL file that was signed.
Problem solved. Nowadays, every third-party vendor I happen to deal with
signs their assembly. It it absolutely not fair for a third-party that
charges money for their product to not sign their assemblies. The two
main reasons are (1) it limits the assemblies I can create and (2) it is
just not good policy for any vendor to ship unsigned assemblies.

(1) is a huge problem. For example, if I need to write an assembly that
must be signed (like for BizTalk consumption) and my assembly has to use
an unsigned vendor's assembly I have *no choice* but to sign their
assembly myself. That is just inexcusable for a vendor to do these days.
Well, silly you for believing the docs when someone who is not prone to
making stuff up has disputed them.

Well silly you for not knowing how Visual Studio works from someone who
has been doing this for seven years!

You'll notice I never said your claim about the docs was wrong. When you
said that I studied the issue and came up with my own test code. The
results are in my last reply as well as above.
If the production assembly is signed, the test assembly has to be too.
If the production assembly isn't signed, the test assembly doesn't have
to be.

Exactly. As I've shown in very precise detail above. I can see what the
docs are trying to say now. They just don't do a very good job, at all.
It's viral in the same way that the GPL is often considered viral - by
applying the property to one thing, it's required for others: if I want
to sign one assembly, I have to sign everything it references *and* any
unit test assemblies which want to reference its internals.

The analogy doesn't hold. Only in the edge case of using
InternalsVisibleTo does this viral claim hold. But then that is the
exact design of InternalsVisibleTo. I can easily see why whoever
designed the attribute made the requirement that if the containing
assembly that uses the attribute is signed then the friend assembly must
also be signed.

But your use of the term viral makes it sounds like you believe signing
an assembly requires any users of the assembly to sign their assembly as
well. And that is just not true. So in all cases *except* when you use
InternalsVisibleTo (and you would not use that in shipping code unless
you signed the assembly anyhow, at least I hope you would) signing an
assembly has no viral aspect to it.
How can doing something be zero effort?

You know exactly what I mean.

How (really, why) are you making it sound oh so time consuming to add a
reference to a key file when you know damn well it takes seconds, which
in any normal developer's book is zero-effort. If you'll admit that this
is extremely simple to do then I'll admit it is not precisely a
zero-effort task.
I've just been upgrading a bunch of projects from 1.1 to 2.0. In each
projects which was signed, in order to avoid warnings I moved the
signing from AssemblyInfo to the properties pane. I then had to
manually edit the project file due to the problem referred to earlier.

Visual Studio is your friend. Let it do it's thing the way it was
designed to. See my description above.
Believe me, this was far from zero effort.

I now understand why you are gun-shy about these key files.
Sounds like you'll get a load of warnings in VS2005, which recommends
setting the key file in the project properties rather than
AssemblyInfo...

This just isn't true. I've updated many projects (solutions) from 03 to
05 with nothing like you mention. Of course, I let VS do all the work
for me; I didn't have to lift a finger. And this is from someone who has
been doing this for seven years, not someone who is making up how VS
studio (doesn't) work.
It does if you have to do it time and time again.

It *doesn't*. To say otherwise is just plain wrong. You add the file
*once* when you create the project and then forget about it.
Customers don't reference our assemblies. (For my open source
libraries, they're welcome to sign it if they want to.)

My question was a hypothetical about using BizTalk and not about open
source libraries. It was also about shipping code (meaning code people
pay for) and not open source libraries. See the difference?

In any event, if I want to sign my assembly (because I have to use
BizTalk, or whatever) how can I use your open source assemblies since
they are not signed? See how not singing makes life difficult for your
assembly users? You claimed above that "it's pretty difficult to do so
[sign a non-signed assembly]". You don't think that's putting an
unnecessary burden on the users of your assembly?
The GAC is a pain in the neck for non-system assemblies, IME. It's
great for framework libraries, but I avoid putting my own ones in
there.

I use the GAC on production systems. It's great for that and makes
assembly management incredibly easy. It sucks for development systems.
The GAC has its place, for system-level assemblies. I can't remember
writing an assembly which I'd classify as system-level.

I'm not sure why you use the moniker system-level. I would say that any
assembly that is sold for money (i.e., is a shipping product) should be
signed, whether or not that product's installer puts it in the GAC
automatically or not.
Strongly-named assemblies have their place too, but it's certainly not
for every assembly IMO.


Please try the simple steps I've shown earlier. I'm really not making
it up about VS copying key files for no reason.

I know. You just got it wrong. It happens!
The strongly-named assembly contains a hash of the data in the
assembly. The obfuscator changes that data - therefore it has to resign
it.

See above. The obfuscator would have to know about the private key in
order to resign the modified assembly.

(Addressed in a previous reply.)
If you find it to be genuinely zero effort, then that's fine - but it's
been a source of annoyance on a number of fronts for me.

I can see that. But give VS a try again regarding this issue. It really
does take care of all the key file stuff and signing stuff for you.
How do you cope with third party components which aren't signed, by the
way?

Yeah, that's what I thought. Those are the assemblies that are a pain in
the butt to deal with.
 
GlennDoten said:
Didn't say you were. You seem to assume I don't know how VS works with
key files, yet I'm the one who has been signing all of his assemblies
for seven years now.

Well, you've shown a way of getting round the problem - for which I
thank you - but that still doesn't mean that VS isn't broken. Copying
the file without even an option not to (in the most obvious dialog -
the one recommended by the compiler warning against using
AssemblyInfo.cs) is broken behaviour, IMO.
This takes a matter of seconds, is done once per project, and to
continue to insist this is some sort of maintenance issue is completely
misleading readers of this thread.

Whereas saying that it takes *zero* effort isn't misleading? If you had
to do it a thousand times, would that still take *zero* effort?
I can't reproduce that.

So yes, if you have a unit test assembly and it references an assembly
that uses InternalsVisibleTo and the referenced assembly is also signed
then the unit test assembly must also be signed.

How is that *not* reproducing it? You've reproduced exactly what I
said!
But that's the whole intent of how the InternalsVisibleTo attribute.

The intent is to make internals visible to another assembly - that the
assembly has to be signed if the original assembly is signed is an
unfortunate consequence in this case, *not* the "whole intent".
Yes, but only in the case of using that attribute. If you are not using
that attribute then the test (or any other assembly) that references a
signed assembly does not itself need to signed.

I never said it did.
Is your point that unit test assemblies require the usage of the
InternalsVisibleTo attribute or something? If so, that's not the case.
You are talking about a fringe case: friend assemblies. Perhaps you use
those a lot; I'm not aware of anyone who does, however.

In order to try to unit test internal methods, you need to use
InternalsVisibleTo. That's the sole reason I have for using
InternalsVisibleTo, but it's a useful one. Quite often the details of
an algorithm shouldn't be exposed to outside assemblies but it's handy
to be able to unit test individual elements of that algorithm.
But even if you were to use InternalsVisibleTo in all your production
assemblies (a strange thing to do, it seems to me) then signing your
unit test assembly is no big deal because it will use precisely the same
assemblies you've already built the production assembly with. Again, no
problem at all.

Except that then all the other assemblies you reference from the unit
test assembly *also* have to be signed.
I don't like having to sign third-party assemblies either, but have done
it a few times. It is incredibly simple to do. Disassemble to IL, add
one directive to the top of the file, reassemble the IL. Done. And it
only needs to be done *once*.

Until the next version comes out, of course.

Again, it's extra effort. Even if it's quite cheap, it's not free.
I have scripts that do this for me for the rare case a third-party does
not and/or will not sign their assembly. I have not seen this in a long
time. Back in the day (2000-2003 or so) I used assemblies from certain
third-party vendors who didn't understand signing and didn't sign their
assemblies. So I made my own version of their DLL file that was signed.
Problem solved. Nowadays, every third-party vendor I happen to deal with
signs their assembly. It it absolutely not fair for a third-party that
charges money for their product to not sign their assemblies. The two
main reasons are (1) it limits the assemblies I can create and (2) it is
just not good policy for any vendor to ship unsigned assemblies.

I'm mostly talking about open source libraries, where of course you can
recompile from the original source - but again that's extra effort.
Well silly you for not knowing how Visual Studio works from someone who
has been doing this for seven years!

Your way of doing things works - that doesn't mean that the
implementation of the suggested way isn't broken.
You'll notice I never said your claim about the docs was wrong. When you
said that I studied the issue and came up with my own test code. The
results are in my last reply as well as above.

I'd pointed out a problem, and you assumed that I was completely
misunderstanding the use of the attribute, based solely on the
documentation.
Exactly. As I've shown in very precise detail above. I can see what the
docs are trying to say now. They just don't do a very good job, at all.

I reported it a while ago - hopefully it'll be fixed at some point.
The analogy doesn't hold. Only in the edge case of using
InternalsVisibleTo does this viral claim hold.

Nope - it just holds in the reverse direction for other references: if
I sign an assembly, everything I reference has to be signed, which
means that everything *it* references has to be signed, which means
that everything *those* assemblies reference has to be signed, etc.

But your use of the term viral makes it sounds like you believe signing
an assembly requires any users of the assembly to sign their assembly as
well.

Nope, it requires that anything I *reference* is signed as well.
And that is just not true.

Which is why I didn't claim it.
So in all cases *except* when you use
InternalsVisibleTo (and you would not use that in shipping code unless
you signed the assembly anyhow, at least I hope you would) signing an
assembly has no viral aspect to it.

It does - signing one thing means I have to sign something else, which
might mean I have to sign something further, etc.
You know exactly what I mean.

How (really, why) are you making it sound oh so time consuming to add a
reference to a key file when you know damn well it takes seconds, which
in any normal developer's book is zero-effort. If you'll admit that this
is extremely simple to do then I'll admit it is not precisely a
zero-effort task.

It's more effort than not doing it, so where there's no benefit from
doing it I won't do it.

I don't want to have to start writing scripts to disassemble 3rd party
assemblies to sign them, just to cope with the viral nature of
assemblies.

I don't want to have to work round Visual Studio's broken behaviour
with regards to the key file being copied.

Where there's a benefit, the effort isn't too much. Where there's no
benefit, I don't see any point in recommending that people go to the
extra effort.
Visual Studio is your friend. Let it do it's thing the way it was
designed to. See my description above.

Then it was badly designed. Typically a single key will be shared
between multiple assemblies, so the default behaviour should *not* be
to copy the key around.
This just isn't true. I've updated many projects (solutions) from 03 to
05 with nothing like you mention. Of course, I let VS do all the work
for me; I didn't have to lift a finger. And this is from someone who has
been doing this for seven years, not someone who is making up how VS
studio (doesn't) work.

So what are you suggesting I've done wrong now? There were project
files which specified the key file in AssemblyInfo.cs. Upgrading to VS
2005 - letting VS do all the work - resulted in extra warnings being
generated.

Just as evidence that I'm not making this up, I'm not the only one to
see it:

http://dougrohm.com/cs/archive/2006/06/18/169.aspx

Oh, and look - that author believes that copying the key file is broken
behaviour too.

Alternatively, you can look it up in MSDN: It's warning CS1699.

So, which part "just isn't true"?

(Out of interest, did you work for Microsoft during 2000? The beta
version of VS .NET 2002 didn't appear until 2001. Even then, of course,
the property page I've been talking about wasn't present until VS 2005,
so you really haven't been doing this specific thing for seven years,
nor upgrading projects from VS.NET 2003 to VS 2005 for that long.)
It *doesn't*. To say otherwise is just plain wrong. You add the file
*once* when you create the project and then forget about it.

*Per project*. While creating a project isn't a daily task, it's not a
"once in a lifetime" task either.
My question was a hypothetical about using BizTalk and not about open
source libraries. It was also about shipping code (meaning code people
pay for) and not open source libraries. See the difference?

I fail to see where "shipping code" necessarily means "commercial
code". However, even sticking to commercial code - far from all
assemblies are meant to be referenced by third parties.
In any event, if I want to sign my assembly (because I have to use
BizTalk, or whatever) how can I use your open source assemblies since
they are not signed?

You can rebuild them from the source.
See how not singing makes life difficult for your
assembly users? You claimed above that "it's pretty difficult to do so
[sign a non-signed assembly]". You don't think that's putting an
unnecessary burden on the users of your assembly?

Well, for a start that's out of context. Here's the full quote:

<quote>
I really don't want to have to sign third party software - and if I
only have the binaries, it's pretty difficult to do so...
</quote>

Spot the "if I only have the binaries" and then think about the fact
that I'm talking about my *open source* assemblies.

Yes, it makes it a little bit harder for anyone who needs it to be
signed. I can't say I've had a *single* email about that though. People
who are signing everything and need it to be signed are presumably used
to the extra effort.

On the other hand, it means that anyone can build their own version of
the library, having changed it a bit, without having a key of any
description. I like that part.
I use the GAC on production systems. It's great for that and makes
assembly management incredibly easy. It sucks for development systems.

I prefer to make development and production as close as possible, to
avoid deployment issues. (Yet another reason to avoid the obfuscation
we both dislike...)
I'm not sure why you use the moniker system-level.

It's the situation I see the GAC being useful in. For things like
NUnit, I reference the assemblies directly and avoid putting them in
the GAC.
I would say that any
assembly that is sold for money (i.e., is a shipping product) should be
signed, whether or not that product's installer puts it in the GAC
automatically or not.

Even if there's no reason whatsoever why you'd want to reference the
assembly?

For commercial components (control libraries etc) I'd agree - but for
standalone products?
I know. You just got it wrong. It happens!

I followed the instructions given by the compiler, and it did an
inappropriate thing. Again I stress: just because there's a workaround
doesn't mean that the behaviour elsewhere is good.
I can see that. But give VS a try again regarding this issue. It really
does take care of all the key file stuff and signing stuff for you.

It didn't take care of the warning message - it just suggested a course
of action which did something inappropriate (copying the file). I fixed
it by editing the project file, but it's still not something I want to
do regularly. Next time I'll certainly use your alternative method -
but that doesn't mean I'm happy about having to.
Yeah, that's what I thought. Those are the assemblies that are a pain in
the butt to deal with.

Whereas if you only sign when you need to, there's no pain unless you
have to sign an assembly which references such a third party library.
 
Jon said:
Well, you've shown a way of getting round the problem - for which I
thank you - but that still doesn't mean that VS isn't broken. Copying
the file without even an option not to (in the most obvious dialog -
the one recommended by the compiler warning against using
AssemblyInfo.cs) is broken behaviour, IMO.

There's no problem to get around. That's how VS has always worked. I can
see your point about the dialog allowing more options, but it's not
necessary and certainly not broken, IMO.
Whereas saying that it takes *zero* effort isn't misleading?

Yes, you know what I mean and you know it takes "zero effort".

If you had
to do it a thousand times, would that still take *zero* effort?

In this case? Yes. Because you'd never do this 1000 times. It seems like
you are making up unrealistic hypotheticals for reasons that are beyond
me. I think we all understand that VS didn't work the way *you* wanted
it to w.r.t. key files so therefore it must be VS' fault. If you use the
tool properly it works just fine and takes "no effort". Just like I
would say it takes "no effort" to add an AssemblyInfo.cs file to a
project or something equally as simple and brainless to do. Why do you
want to make this out to be more complicated than it is?
How is that *not* reproducing it? You've reproduced exactly what I
said!

You're right. I shouldn't have said "I can't reproduce that." I missed
cutting that out during my proof-read of my post after showing you how
the attribute is supposed to work. My mistake.
The intent is to make internals visible to another assembly - that the
assembly has to be signed if the original assembly is signed is an
unfortunate consequence in this case, *not* the "whole intent".

It is not an "unfortunate consequence." It is quite by design that the
usage of that attribute within a signed assembly requires you to sign
the friend assembly. And that's the way it should be and is the indeed
the intent. Why do you think a friend assembly should not be signed if
the assembly it is allowed to see the private members for is signed? It
makes complete sense to me and more importantly that is how it is
implemented.

But this is a red-herring you've thrown in and really has nothing to do
with the general precept and good practice of signing any assembly you
create because it is *the easiest thing to do* when creating the most
flexible of assemblies.
I never said it did.

Sure. Whatever you say.
In order to try to unit test internal methods, you need to use
InternalsVisibleTo. That's the sole reason I have for using
InternalsVisibleTo, but it's a useful one. Quite often the details of
an algorithm shouldn't be exposed to outside assemblies but it's handy
to be able to unit test individual elements of that algorithm.

Um, no you don't have to use that attribute. Clearly you haven't used
Visual Studio's test framework, either.
Except that then all the other assemblies you reference from the unit
test assembly *also* have to be signed.

That's what I just said.
Until the next version comes out, of course.

Yup. If a vendor insists on distributing an assembly without signing it
and you must have it signed this is an absolutely correct observation.
But so what, what's your point?
Again, it's extra effort. Even if it's quite cheap, it's not free.

It's as free as these things get. Don't try to lead readers of this
thread to think that it's some big god-awful bit of work. It ain't.
I'm mostly talking about open source libraries, where of course you can
recompile from the original source - but again that's extra effort.

Yes, effort that users of such libraries should not have to expend.
Your way of doing things works - that doesn't mean that the
implementation of the suggested way isn't broken.

Jesus! It's not my way of doing things. It's how Visual Studio works.
And it works perfectly. *You* may not like how VS is implemented and
*you* may like to see some changes to VS, but that's *your* problem.
When used properly, the tool (VS) works perfectly well.
I'd pointed out a problem, and you assumed that I was completely
misunderstanding the use of the attribute, based solely on the
documentation.

Yes, silly me for believing the documentation. Nowhere prior to my
questioning your comment did you say you had actually worked with the
documentation. And once I tested this all out for myself (because you
were clearly showing a lack of understanding on how VS works) I admitted
my mistake. What's the problem there? You, on the other hand, cannot
seem to admit your misunderstanding of VS but being unable to make the
blame stick to me you blame the tool. What's up with that, Jon?
I reported it a while ago - hopefully it'll be fixed at some point.

Yes, clearer documentation on that attribute would be nice. But it
*still* is a red-herring that really has nothing to do with the central
discussion point here.
Nope - it just holds in the reverse direction for other references: if
I sign an assembly, everything I reference has to be signed, which
means that everything *it* references has to be signed, which means
that everything *those* assemblies reference has to be signed, etc.

If you are able to sign your assembly there is absolutely nothing viral
about that. If you are able to sign your assembly you have already
worked out any issues there might be with dependent assemblies. You
described viral as being that users of the assembly you just created
*and signed* is somehow viral and causes users to have to sign their
assemblies. That just ain't so! Users of a signed assembly *do not* have
to sign their assembly. If they did, then it would be so-called viral,
and I would agree with you.
Nope, it requires that anything I *reference* is signed as well.

Nope, only if you want to sign *your* assembly. Re-read what you just
quoted me as saying: "it sounds like you believe signing an assembly
requires any users of the assembly to sign their assembly as well." It
still sounds like you are trying to say that. Users of a signed assembly
do not require that anything you reference in your assembly that uses
the signed assembly must be signed! Why are you arguing that?

If I create an assembly, and sign it and call it AS, and it uses an
assembly called D1, yes, D1 must be signed. But of course it does
otherwise I would never have been able to sign AS. If you create a
unsigned assembly called J and you want to use AS (which is already
signed) and you also want to use assembly ANS which is not signed, *you
can do that!* You're J can use my signed AS at the same time it uses the
unsigned ANS. What are you arguing against here? I am missing something
fundamental in your argument, I think.
It does - signing one thing means I have to sign something else, which
might mean I have to sign something further, etc.

Well go ahead and ignore the *direction* of these dependencies. I don't
know why you are intentionally making this difficult for people to
follow, but you are. Signing is extremely simply, not only conceptually
but in practice as well. Signing requires dependencies that are used by
*signed* assemblies to be signed themselves - it *does not require*
users of a signed assembly to have to sign their assembly if they do not
want to.
It's more effort than not doing it, so where there's no benefit from
doing it I won't do it.

I've given the benefits a couple of times now and will not reiterate
them again. You are obviously quite free to not sign assemblies that you
create. But that you make this decision for your own assemblies has
absolutely nothing to do with my precept that it is a best practice to
simply sign all assemblies that a person creates. I really don't care
what you want to do with your own assemblies at this point. But if you
would care to debate the pros and cons of what I have been saying and
have maintained all along please do.
I don't want to have to start writing scripts to disassemble 3rd party
assemblies to sign them, just to cope with the viral nature of
assemblies.

I don't either. And if vendors would sign their assemblies you wouldn't
have to. You're too funny. Just because you say signing an assembly
gives it some sort of viral nature doesn't make it so. I've explained
why but you choose to obfuscate the issue rather than accept the fact
the users of a signed assembly do not have to sign their assemblies to
used the signed one which disproves your claim to virility (is that a
word?) You just keep telling yourself that there is some viral nature
you must cope with; the rest of us will continue to happily sign our
assemblies and be done with it once and for all. Signing them are the
easiest way to create assemblies, for everyone and every tool involved.
I don't want to have to work round Visual Studio's broken behaviour
with regards to the key file being copied.

There's nothing that needs to be worked around w.r.t. VS. Just admit it.
You didn't know how to link files in VS and that how by doing so the VS
application properties drop-down then automagically finds the key file.
I didn't know that either when I first went from VS'03 to VS'05, but
it's a pretty sharp feature.
Where there's a benefit, the effort isn't too much. Where there's no
benefit, I don't see any point in recommending that people go to the
extra effort.

I've given plenty of points to recommend. Why don't you address those
points instead of ignore them? Tools like BizTalk require signed
assemblies? How would you recommend people work around that? (Not using
BT is acceptable in my book! It's a beast.) Why don't you address the
point about a user not being able to sign their assembly if some vendor
refuses to simply sign their paid-for asssembly or assemblies? What's
the work-around for that than what I've already said. Jon, I'm afraid
you have lost me in this discussion.
Then it was badly designed. Typically a single key will be shared
between multiple assemblies, so the default behaviour should *not* be
to copy the key around.

You are entitled to your opinion. I happen to think VS works wonderfully
with key files. What you should be doing is putting one copy of the key
file in the solution directory. Then *link* (as I've described in my
comments you so conveniently snipped away) to the key file in each
project that you add to the solution as you add it to the solution. Then
go to the signing tab *just once* for each project as you add the
project to the solution. That's how VS is designed to work. You really
do want you key file in the solution so that you can more easily add it
to your source control system.

I've through all of these configuration issues with VS over and over for
the past seven years at the various multinationals and mom and pop shops
I've held contracts at. *It works!* *I'm not making this up!*

Have you ever tried to deal with BizTalk and vendor assemblies that
aren't signed in a large corporation? If so, what has your-workaround
been when you have to sign an assembly for BizTalk's sake (or for many
other reasons) and you run across an assembly some dopey vendor has
decided not to sign?
So what are you suggesting I've done wrong now? There were project
files which specified the key file in AssemblyInfo.cs. Upgrading to VS
2005 - letting VS do all the work - resulted in extra warnings being
generated.

Couldn't tell ya. I'd have to see the VS'03 solution and how it was set
up and then see what was done in VS'05.
Just as evidence that I'm not making this up, I'm not the only one to
see it:

http://dougrohm.com/cs/archive/2006/06/18/169.aspx

Yes, this fellow also does not know how to link files in VS: "When I
referenced this strong name key file, VS2005 copied it into the project."

I thought it was common VS knowledge about linking files like the key
file and creating a solution-wide .cs file for the solution-specific
attributes that by default are placed in AssemblyInfo.cs so they can be
shared by all projects. Guess not.
Oh, and look - that author believes that copying the key file is broken
behaviour too.

Bully for him! You two need to send a change request to MS, I guess.
Alternatively, you can look it up in MSDN: It's warning CS1699.

Yeah, that's a compiler warning. OK, what's your point?
So, which part "just isn't true"?

All the stuff I've pointed out, for a second time now.
(Out of interest, did you work for Microsoft during 2000? The beta
version of VS .NET 2002 didn't appear until 2001. Even then, of course,
the property page I've been talking about wasn't present until VS 2005,
so you really haven't been doing this specific thing for seven years,
nor upgrading projects from VS.NET 2003 to VS 2005 for that long.)

Oh come on. I said I have been signing assemblies since 1999 or 2000. I
never said I've been signing assemblies with VS'05 since then. I've just
kept up with how the different versions of VS work as they've come out.
*Per project*. While creating a project isn't a daily task, it's not a
"once in a lifetime" task either.

Whatever. You keep frightening everyone with this line, the rest of us
will continue to take the five seconds required to add a key file
reference to a project.
I fail to see where "shipping code" necessarily means "commercial
code". However, even sticking to commercial code - far from all
assemblies are meant to be referenced by third parties.

These word games of yours are tiresome. Can you not argue the point?
Must you continue this game of trying to shift the subject to something
it isn't and is clearly not what I said?
You can rebuild them from the source.

Oh I see your point. It's better to make untold numbers of people
rebuild your assembly from source than for *one person* (that's you) to
take a *few seconds* to reference a key file in your project.
See how not singing makes life difficult for your
assembly users? You claimed above that "it's pretty difficult to do so
[sign a non-signed assembly]". You don't think that's putting an
unnecessary burden on the users of your assembly?

Well, for a start that's out of context.

So why not answer the question? You don't think that's putting an
unnecessary burden on the users of your assembly? (No, I didn't quote
you out of context, BTW.)
Here's the full quote:

<quote>
I really don't want to have to sign third party software - and if I
only have the binaries, it's pretty difficult to do so...
</quote>

Spot the "if I only have the binaries" and then think about the fact
that I'm talking about my *open source* assemblies.

Yes, it makes it a little bit harder for anyone who needs it to be
signed.

Oh but taking a few seconds to sign the thing once to begin with is
"pretty difficult?" I'm now at a loss for words (believe it or not!)
I prefer to make development and production as close as possible, to
avoid deployment issues. (Yet another reason to avoid the obfuscation
we both dislike...)

You put all your development tools on your production systems? How
bizarre. I make my test and QA and staging systems match production as
much as possible, there's no way development boxes will ever come close
to looking like a production box at the places I've worked. Even the
operating systems are entirely different.
It's the situation I see the GAC being useful in. For things like
NUnit, I reference the assemblies directly and avoid putting them in
the GAC.

However, the GAC is still useful in many more situations.
Even if there's no reason whatsoever why you'd want to reference the
assembly?

You lost me there: What good is an assembly if no one references it?
For commercial components (control libraries etc) I'd agree - but for
standalone products?

Yes. Sign *any and all* assemblies. It makes life easiest for everyone.
I followed the instructions given by the compiler, and it did an
inappropriate thing. Again I stress: just because there's a workaround
doesn't mean that the behaviour elsewhere is good.

You should have read the VS instructions first, I guess.
It didn't take care of the warning message - it just suggested a course
of action which did something inappropriate (copying the file). I fixed
it by editing the project file, but it's still not something I want to
do regularly. Next time I'll certainly use your alternative method -
but that doesn't mean I'm happy about having to.

Well, if you were doing what the fellow at dougrohm.com that you quoted
was doing then you didn't have your solution configured properly in
VS'03. Sure, it'll let you do that, but I learned back with VS 7.0 (I
think that was the version #) not to keep solution files outside the
solution directory. Doing that also tends to confuse source control systems.
Whereas if you only sign when you need to, there's no pain unless you
have to sign an assembly which references such a third party library.

Again, that has nothing to do with my question.
 
GlennDoten said:
There's no problem to get around. That's how VS has always worked. I can
see your point about the dialog allowing more options, but it's not
necessary and certainly not broken, IMO.

Clearly I disagree - and as I've shown, I'm not the only one who thinks
this is unintuitive and unhelpful behaviour.
Yes, you know what I mean and you know it takes "zero effort".


In this case? Yes. Because you'd never do this 1000 times. It seems like
you are making up unrealistic hypotheticals for reasons that are beyond
me. I think we all understand that VS didn't work the way *you* wanted
it to w.r.t. key files so therefore it must be VS' fault. If you use the
tool properly it works just fine and takes "no effort". Just like I
would say it takes "no effort" to add an AssemblyInfo.cs file to a
project or something equally as simple and brainless to do. Why do you
want to make this out to be more complicated than it is?

Why do you want to make it out to be *less* complicated than it is?
I've never claimed it's a massive amount of effort - just that it's
non-zero, that using VS the way that *it* recommends does something
which will be wrong for a significant number of people, and that
genuinely doing nothing is easier than doing *something*.
You're right. I shouldn't have said "I can't reproduce that." I missed
cutting that out during my proof-read of my post after showing you how
the attribute is supposed to work. My mistake.

Thanks. That certainly takes a bit of the heat out of the conversation.
It is not an "unfortunate consequence." It is quite by design that the
usage of that attribute within a signed assembly requires you to sign
the friend assembly. And that's the way it should be and is the indeed
the intent. Why do you think a friend assembly should not be signed if
the assembly it is allowed to see the private members for is signed? It
makes complete sense to me and more importantly that is how it is
implemented.

It makes sense to me in the way that assembly references from signed
assemblies work. It's unfortunate in that I really don't want it to
work that way for the use I make of InternalsVisibleTo.
But this is a red-herring you've thrown in and really has nothing to do
with the general precept and good practice of signing any assembly you
create because it is *the easiest thing to do* when creating the most
flexible of assemblies.

It's not easier than not signing it when it doesn't need to be signed.
In cases where I'm *not* using InternalsVisibleTo, why would I want to
sign a unit test assembly?
Um, no you don't have to use that attribute. Clearly you haven't used
Visual Studio's test framework, either.

I use NUnit rather than MSTest because I use VS Professional. I'm
intrigued though - how does MSTest let you access non-public members
from test assemblies?
That's what I just said.

Um, no. You were talking about assemblies that the production
assemblies use. I was talking about assemblies that the unit test
assembly references. They're not necessarily the same thing. I'm not in
the habit of referencing unit test helper libraries, mocking frameworks
etc from production code.
Yup. If a vendor insists on distributing an assembly without signing it
and you must have it signed this is an absolutely correct observation.
But so what, what's your point?

That it's another point of effort.
It's as free as these things get. Don't try to lead readers of this
thread to think that it's some big god-awful bit of work. It ain't.

You've been trying to give the impression that it's really no effort at
all to sign assemblies, when in reality it *is* effort. Is it very much
effort? No. Is it more effort than not signing assemblies when you
don't need to? Yes - particularly when it means having to rebuild third
party assemblies. (Depending on your view on key storage, you also need
to work out an appropriate security strategy etc. May or may not be an
issue depending on the situation.)
Yes, effort that users of such libraries should not have to expend.

But according to you it's no effort to do anyway, is it? Given that
you're getting the code for free
Jesus! It's not my way of doing things. It's how Visual Studio works.
And it works perfectly. *You* may not like how VS is implemented and
*you* may like to see some changes to VS, but that's *your* problem.
When used properly, the tool (VS) works perfectly well.

1) It doesn't do what I *expect*
2) It doesn't do what I *want*
3) By default (using the method recommended by the compiler, no less)
it tries to add a potentially security-sensitive piece of
information into source control
4) It's not just me that finds this behaviour inappropriate, as I've
shown elsewhere.
Yes, silly me for believing the documentation. Nowhere prior to my
questioning your comment did you say you had actually worked with the
documentation. And once I tested this all out for myself (because you
were clearly showing a lack of understanding on how VS works) I admitted
my mistake. What's the problem there? You, on the other hand, cannot
seem to admit your misunderstanding of VS but being unable to make the
blame stick to me you blame the tool. What's up with that, Jon?

The difference is that I'd already made a claim about a problem with
InternalsVisibleTo which indicated that it didn't behave in accordance
with the documentation. You chose to believe the documentation blindly,
assuming that I was the one in the wrong. If I'm looking at someone's
claim that some code behaves in one way and the documentation says
something else, I try it first.

Now, when it came to signing in VS, I followed what VS suggested: and
it did the wrong thing for me (and the wrong thing for anyone who
didn't want the key copied - which I believe is many people). I then
reported here that it was doing the wrong thing. I fail to see where my
fault lies there.
Yes, clearer documentation on that attribute would be nice. But it
*still* is a red-herring that really has nothing to do with the central
discussion point here.

I disagree, because again it means that more needs to be signed. It
means there's less of a half-way house. If you are going to sign
absolutely everything, I agree that it makes no difference. Can you not
see that some people may agree with you to the extent of wanting to
sign all production assemblies, but *not* extend that to signing test
assemblies and their dependencies?
If you are able to sign your assembly there is absolutely nothing viral
about that. If you are able to sign your assembly you have already
worked out any issues there might be with dependent assemblies. You
described viral as being that users of the assembly you just created
*and signed* is somehow viral and causes users to have to sign their
assemblies. That just ain't so! Users of a signed assembly *do not* have
to sign their assembly. If they did, then it would be so-called viral,
and I would agree with you.

No, here's how I described viral:

"by applying the property to one thing, it's required for others"

The "others" in this case are everything it references, *and* anything
that it wants to give friend access to.

I don't see that it has to be extending to "users" rather than "used"
to count as viral.
Nope, only if you want to sign *your* assembly. Re-read what you just
quoted me as saying: "it sounds like you believe signing an assembly
requires any users of the assembly to sign their assembly as well." It
still sounds like you are trying to say that.

No, I've never said that and wouldn't say that. What I've been saying
(and which you agree with, I believe) is that if I sign assembly X, I
have to make sure that everything X references (*not* everything that
references X) is signed. That may well include assemblies I wouldn't
otherwise have signed - hence the viral nature. "By applying the
property (assembly signing) to one thing (assembly X), it's required
for others (the assemblies X references)." Does that make it clearer?
Users of a signed assembly
do not require that anything you reference in your assembly that uses
the signed assembly must be signed! Why are you arguing that?

I'm not. Please don't put words in my mouth.
If I create an assembly, and sign it and call it AS, and it uses an
assembly called D1, yes, D1 must be signed. But of course it does
otherwise I would never have been able to sign AS. If you create a
unsigned assembly called J and you want to use AS (which is already
signed) and you also want to use assembly ANS which is not signed, *you
can do that!* You're J can use my signed AS at the same time it uses the
unsigned ANS. What are you arguing against here? I am missing something
fundamental in your argument, I think.

You're arguing against something I've never claimed. Hopefully two
paragraphs above will clarify it.
Well go ahead and ignore the *direction* of these dependencies. I don't
know why you are intentionally making this difficult for people to
follow, but you are. Signing is extremely simply, not only conceptually
but in practice as well. Signing requires dependencies that are used by
*signed* assemblies to be signed themselves - it *does not require*
users of a signed assembly to have to sign their assembly if they do not
want to.

And once *again* - I've never said that it does. I don't believe that
makes it any less viral. A good example of this came up just recently
at work: I was trying to test a signed assembly, and I wanted to use
InternalsVisibleTo. That meant I had to sign the test assembly... so I
tried that, but then of course it referenced other assemblies which
weren't signed... which in turn referenced other assemblies which
weren't signed. Rather than follow this chain of signing dependencies,
I ended up making the member public - but the point is that the
"signed-ness" was "trying" to spread itself (with trying in *heavily*
inverted commas, I want to point out).

Now, don't get me wrong: I can see *why* references from signed
assemblies need to be signed. That doesn't make it any simpler when I
don't want to sign those references though - in the same way that I can
understand why deterministic finalization isn't part of .NET, but I
sometimes wish it were.
I've given the benefits a couple of times now and will not reiterate
them again. You are obviously quite free to not sign assemblies that you
create. But that you make this decision for your own assemblies has
absolutely nothing to do with my precept that it is a best practice to
simply sign all assemblies that a person creates. I really don't care
what you want to do with your own assemblies at this point. But if you
would care to debate the pros and cons of what I have been saying and
have maintained all along please do.

Unless you have to sign it for the sake of InternalsVisibleTo, what is
the benefit in signing unit test assemblies? Why is that best practice?
I don't either. And if vendors would sign their assemblies you wouldn't
have to. You're too funny. Just because you say signing an assembly
gives it some sort of viral nature doesn't make it so. I've explained
why but you choose to obfuscate the issue rather than accept the fact
the users of a signed assembly do not have to sign their assemblies to
used the signed one which disproves your claim to virility (is that a
word?)

It doesn't disprove it, it just means that you're asssuming that being
viral only applies in one direction. As far as I'm concerned, if the
property effectively spreads itself (this time via the relationship of
"referred to" rather than "referenced by") when I may not want it to,
then it's viral.
You just keep telling yourself that there is some viral nature
you must cope with; the rest of us will continue to happily sign our
assemblies and be done with it once and for all. Signing them are the
easiest way to create assemblies, for everyone and every tool involved.

If you believe that "the rest of us" are already signing everything,
why have you been having to suggest that people *start* doing so?
There's nothing that needs to be worked around w.r.t. VS. Just admit it.
You didn't know how to link files in VS and that how by doing so the VS
application properties drop-down then automagically finds the key file.
I didn't know that either when I first went from VS'03 to VS'05, but
it's a pretty sharp feature.

I knew about linking files in general - I hadn't tried applying it to
key files. Silly me, I tried doing what the documentation recommended.
I've given plenty of points to recommend. Why don't you address those
points instead of ignore them? Tools like BizTalk require signed
assemblies? How would you recommend people work around that? (Not using
BT is acceptable in my book! It's a beast.) Why don't you address the
point about a user not being able to sign their assembly if some vendor
refuses to simply sign their paid-for asssembly or assemblies? What's
the work-around for that than what I've already said. Jon, I'm afraid
you have lost me in this discussion.

Have I ever suggested not to sign *any* assemblies? No. I've explicitly
said that there are times when it's worth signing assemblies. I've just
been arguing that it:

1) It *isn't* zero effort
2) Following the compiler's recommendations gives broken behaviour for
most users
3) Signing has a viral nature which is understandable but can be
unfortunate
You are entitled to your opinion. I happen to think VS works wonderfully
with key files. What you should be doing is putting one copy of the key
file in the solution directory. Then *link* (as I've described in my
comments you so conveniently snipped away) to the key file in each
project that you add to the solution as you add it to the solution.

And if the compiler had suggested doing that, then it wouldn't have
been a problem. However, I went to the suggested property tab, and it
did the wrong thing - for me and for other people.

I'm glad there's a workaround, and as I've said before I'll use it
(hence the snipping - I've never tried to deny that your workaround
works) - but I still believe the VS property tab's behaviour is badly
designed.
Then go to the signing tab *just once* for each project as you add the
project to the solution. That's how VS is designed to work. You really
do want you key file in the solution so that you can more easily add it
to your source control system.

It's fewer clicks to add a single file to source control than it is to
make an assembly signed - and therefore zero effort in your view,
surely. And this really *can* be a one-off hit; it doesn't even need to
be once per solution - if you want to share a key across multiple
solutions and multiple projects, you don't need to add it to source
control more than once.

That's assuming you *want* to have it in source control, of course - in
some environments you may well not want it in the relatively public
gaze of source control to start with.
I've through all of these configuration issues with VS over and over for
the past seven years at the various multinationals and mom and pop shops
I've held contracts at. *It works!* *I'm not making this up!*

Nor was I making up its broken copying behaviour.
Have you ever tried to deal with BizTalk and vendor assemblies that
aren't signed in a large corporation? If so, what has your-workaround
been when you have to sign an assembly for BizTalk's sake (or for many
other reasons) and you run across an assembly some dopey vendor has
decided not to sign?

I've never used BizTalk, but I would of course sign any assemblies that
I wanted to use with it. And if I were a component vendor, I'd sign
those component assemblies too. I'm not a component vendor, however. I
never expect my assemblies to be used with BizTalk - they're not meant
to be API assemblies in the first place.
Couldn't tell ya. I'd have to see the VS'03 solution and how it was set
up and then see what was done in VS'05.

It was a simple AssemblyKeyFile attribute in AssemblyInfo.cs. The
solution still built and was signed after upgrade, but with an extra
warning. I can't easily reproduce it on my home laptop as I don't have
VS2003 on it, but if you still believe I was doing something wrong I
could try to create a sample solution on my other machine.
Yes, this fellow also does not know how to link files in VS: "When I
referenced this strong name key file, VS2005 copied it into the project."

Yes, again someone followed the recommendation of the compiler. How
terrible of him.
I thought it was common VS knowledge about linking files like the key
file and creating a solution-wide .cs file for the solution-specific
attributes that by default are placed in AssemblyInfo.cs so they can be
shared by all projects. Guess not.

I can't say I've ever created a solution-wide .cs file, although I've
linked other .cs files at other times.
Bully for him! You two need to send a change request to MS, I guess.

I might put a feature request on connect.microsoft.com, I suppose.
Yeah, that's a compiler warning. OK, what's your point?

That it exists. That I'm not making it up.
All the stuff I've pointed out, for a second time now.

Here's what I wrote:

<quote>
Sounds like you'll get a load of warnings in VS2005, which recommends
setting the key file in the project properties rather than
AssemblyInfo...
</quote>

Now, do you believe that it "isn't true" that VS2005 recommends setting
the key file in the project properties rather than AssemblyInfo?
Oh come on. I said I have been signing assemblies since 1999 or 2000. I
never said I've been signing assemblies with VS'05 since then. I've just
kept up with how the different versions of VS work as they've come out.

Signing assemblies since 1999 eh? Before .NET was even *announced* -
very impressive!
Whatever. You keep frightening everyone with this line, the rest of us
will continue to take the five seconds required to add a key file
reference to a project.

I like to streamline development where I can - so if there's no benefit
from signing an assembly in a particular situation (most unit test
projects, for instance) why should I do it?
These word games of yours are tiresome. Can you not argue the point?
Must you continue this game of trying to shift the subject to something
it isn't and is clearly not what I said?

I don't see how you "clearly" meant commercial code when you said
shipping code. Likewise I don't see how you "clearly" meant component
code rather than assemblies which are never meant to be referenced by
other developers.
Oh I see your point. It's better to make untold numbers of people
rebuild your assembly from source than for *one person* (that's you) to
take a *few seconds* to reference a key file in your project.

If anyone ever actually mails me about this, I'll start signing at that
point. Until anyone expresses an interest in having the assembly
signed, I don't see where the benefit is.
See how not singing makes life difficult for your
assembly users? You claimed above that "it's pretty difficult to do so
[sign a non-signed assembly]". You don't think that's putting an
unnecessary burden on the users of your assembly?

Well, for a start that's out of context.

So why not answer the question? You don't think that's putting an
unnecessary burden on the users of your assembly?

My users don't seem to think so, or at least they haven't made any
mention of it. Of course, I've no idea how many users I actually
have...
(No, I didn't quote you out of context, BTW.)

Yes, you did. You included part of a quote which was about signing
assemblies where only the binary was available, and applied it to my
library where the source is available.
Oh but taking a few seconds to sign the thing once to begin with is
"pretty difficult?" I'm now at a loss for words (believe it or not!)

I'm at a loss to see how you are missing the point so badly:

Open source -> Can easily be rebuilt -> Signing makes it a little bit
harder

Only binaries available -> Can't easily be rebuilt (needs
disassembling) -> "pretty difficult"

I don't think I've ever said it was "pretty difficult" to sign the
library to start with - just more effort than not signing it.
You put all your development tools on your production systems? How
bizarre. I make my test and QA and staging systems match production as
much as possible, there's no way development boxes will ever come close
to looking like a production box at the places I've worked. Even the
operating systems are entirely different.

Maybe I should rephrase: "Where I have a choice between two simple
options, one of which makes development and deployment more different,
and one of which keeps them similar, I'll keep them similar."

That includes not using the GAC for my assemblies.
However, the GAC is still useful in many more situations.

I'm glad you find it so - I prefer XCopy deployment for my own
assemblies.
You lost me there: What good is an assembly if no one references it?

Um, being an application? Or being referenced by an application from
the same vendor?
Yes. Sign *any and all* assemblies. It makes life easiest for everyone.

It makes it no easier for applications or unit test assemblies which
don't need access to internals.
You should have read the VS instructions first, I guess.

No, VS should just offer more sensible behaviour in its property pages,
IMO.
Well, if you were doing what the fellow at dougrohm.com that you quoted
was doing then you didn't have your solution configured properly in
VS'03. Sure, it'll let you do that, but I learned back with VS 7.0 (I
think that was the version #) not to keep solution files outside the
solution directory. Doing that also tends to confuse source control systems.

Again, you're assuming that the key file is effectively owned by the
solution. That's a pain if you've got multiple solutions which want to
use the same key. With a relative path in the project file, nothing's
been confused so far - it was just more effort than it would have been
if VS had put that relative path in to start with.
Again, that has nothing to do with my question.

It has everything to do with your claim that it's worth signing
everything. Consider this situation:

1) I have a production assembly. I might choose to sign it - irrelevant
to this example.
2) I have a unit test assembly, which doesn't need access to the
internals of the production assembly.
3) I have a third party assembly referenced by the unit test assembly.
It's not signed.

Now, where is the benefit in signing assembly 2, given that it means
rebuilding (possibly from the binaries - which may be against the
licence) assembly 3?
 
Jon Skeet said:
It's viral in the same way that the GPL is often considered viral - by
applying the property to one thing, it's required for others: if I want
to sign one assembly, I have to sign everything it references *and* any
unit test assemblies which want to reference its internals.

Looking back on the thread, I suspect that bringing the GPL into this
may have been a cause for confusion. The direction of "infection" of
signing is indeed in a different direction than that of the GPL - with
the GPL, it's any software that *uses* the GPL code that is "infected"
with it, whereas with signing it's the other way round.

Hopefully my previous reply will have cleared up exactly what I meant
anyway, but I just wanted to apologise if this was the source of the
confusion.
 
<snip>

I think a word of apology is in order. I'm not (currently!) backing
down on any of my opinions, but I would like to apologise for my part
in the tone of this discussion becoming ever more heated.

My feeling is that we agree on all the definite technical aspects, but
disagree on the effort involved in signing, the benefits of signing
assemblies which don't *really* need to be signed, and the validity or
otherwise of VS's behaviour on the project property page.

Does that sound about right? I don't in any way mean to discourage
further replies to my earlier posts - but hopefully if I post any more
on this thread, it'll be in a more constructive manner.

Apologies again.
 
I think a word of apology is in order. I'm not (currently!) backing
down on any of my opinions, but I would like to apologise for my part
in the tone of this discussion becoming ever more heated.

Nice and professional of you to offer that. IMHO nothing is wrong if things
become a bit heated - as long as they stay on topic and don't degenerate to
personal shots (which I saw none of here). I do appreciate you sticking with
the thread even in the face of strong disagreement. Peter Duniho has
recently done the same in other threads. FWIW, you guys [both sides of the
issue] hanging in there to support your views might not be fun for you, but
the added perspective of the issues [that comes out] can be VERY helpful to
those of us with less specialized knowledge.

-S
 
Smithers said:
I think a word of apology is in order. I'm not (currently!) backing
down on any of my opinions, but I would like to apologise for my part
in the tone of this discussion becoming ever more heated.

Nice and professional of you to offer that. IMHO nothing is wrong if things
become a bit heated - as long as they stay on topic and don't degenerate to
personal shots (which I saw none of here). I do appreciate you sticking with
the thread even in the face of strong disagreement. Peter Duniho has
recently done the same in other threads. FWIW, you guys [both sides of the
issue] hanging in there to support your views might not be fun for you, but
the added perspective of the issues [that comes out] can be VERY helpful to
those of us with less specialized knowledge.

Thanks - it's never obvious when a thread is still useful to other
people, and when it's just degenerated into two voices which no-one
else is listening to. The curse of the passive nature of NNTP, I
guess...
 
Back
Top