There's no such beastie in the SDK, although secutil.exe probably comes
closer to your needs than sn.exe, although it provides the full signing key
rather than the token that you would prefer. That said, it's really quite
trivial to write a little app to do this. e.g. (console app):
using System;
using System.Reflection;
using System.Windows.Forms;
namespace StrongNameReader
{
internal sealed class Program
{
[STAThread]
private static void Main(string[] args)
{
try
{
if (args.Length == 1)
{
string assemblyName =
Assembly.ReflectionOnlyLoadFrom(args[0]).FullName;
Clipboard.SetText(assemblyName);
Console.WriteLine(assemblyName);
}
else
{
if (args.Length == 0)
{
throw new ArgumentException("Please provide an assembly path");
}
else
{
throw new ArgumentException("Please provide one assembly path only.");
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
William Sullivan said:
See... that's just it. No strong name. Just PARTS of the strong name.
I'm
looking for an easy way to get the strong name of an assembly... As in,
"AssemblyName, Version=0.0.0.0, Culture=Neutral,
PublicKeyToken=1111111111111111". What SN gives you is bread crumbs that
you
have to press together to make a retarded loaf. Chance of errors when
doing
this? What do you think? I'm wondering if there is a tool already out
there
that, when you hand it an assembly, hands you back the ENTIRE strong name.
Maybe even pastes it into the clipboard, I don't know... At a minimum it
would give you back, get this, not the PKT, not the version, not the
culture,
but the whole shebang WHAM! Right there! Look, its the strong name of
the
assembly! I can just copy the whole thing and paste it right into my
program, without any worries that I screwed up adding little pieces from
this
place and that together...