I have a windows service written in C#. It dynamically generates C# code and compiles them to assemblies as abc.dll, xyz.dll etc. These assemblies are later loaded for execution. When compiling, I pass /keyfile: mykeyfile.snk" as one of the compiler options to System.CodeDom.Compiler.CompilerParameters class. Now the problem: Some of these assemblies fail to load because strong name validation fails.
I got the generated assemblies from the test system and when I check them with sn,exe, I see that about 1 in 6 assembly is delay or test signed. Running sn.exe -v xyz.dll gives me xyz.dll is a delay-signed or test-signed assembly. Obviously it will fail to load.
Why some assemblies aren’t properly signed?