We recently ran into an issue where upon pulling some new 3rd party dependencies into our product our CI pipeline broke! I when I say broke, I mean it came to a screeching halt!
We were totally unable to compile in Release mode due to the new dependencies not being strongly named and signed. The error message in the build log was
CSC : error CS1577: Assembly generation failed -- Referenced assembly 'MvcContrib.FluentHtml' does not have a strong name
Sign it yourself!
Eric Hexter, of the MvcContrib team, pointed me to a thread explaining how to strongly-name and sign the assembly without having to recompile it. After a few failed attempts, I ended up using the IL Disassembler and Assembler to get the job done. The template for a single DLL follows.
1: > ildasm {path\to\assembly}.dll /out:{path\to\assembly}.il
2: > move {path\to\assembly}.dll {path\to\assembly}.dll.orig
3: > ilasm {path\to\assembly}.il /dll /key={path\to\SigningKey}.snk
The second line could really just be a delete, but whatever. The point is, the third line is going to output a new DLL of the same name as the original, so get rid of the original first.
After that, I committed the new assembly into our source tree, the CI build pipeline kicked off, and we were back to green!
Technorati Tags:
.net,
trick,
security