O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Strong-Name Verification at Runtime

When strong-named assemblies are referenced, the CLR is put in a mode where it pays extra attention to integrity of dependencies. When the runtime locates assemblies, it makes sure the strong name matches exactly what the assembly manifest refers to. If not, an exception is triggered.

As an exercise, change the version number of the calc.dll assembly by tweaking the AssemblyVersion attribute and recompiling calc.dll:

// Calc.csusing System.Reflection;[assembly: AssemblyVersion("2.0.0.0")]public static class Calc{    public static int Add(int a, int b)    {        return a + b;    }}

Don’t recompile program.exe and try to run it with the newer version of calc.dll sitting next to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required