Use of SuppressIldasmAttribute
We use ildasm in our build deployment pipeline. Recently one internal partner pinged me saying that it was failing with a weird message that ildasm is failing to disassemble one particular assembly. I instantly assumed it to be a race condition (locks taken on the file, some sort of anti-virus holding read locks, etc). However, he reported back it is a persistent problem. I asked for the assembly and tried to run
ildasm foo.dll
I was greeted with
Dumbfounded I dug around and found this weird attribute on this assembly
[assembly: SuppressIldasmAttribute]
MSDN points out https://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.suppressildasmattribute(v=vs.110).aspx that this attribute is to make ildasm not disassembly a given assembly. For the life of me I cannot fathom why someone invented this attribute. This is one of those things which is so surreal…. Obviously you can simply point reflector or any of the gazillion other disassemblers to this assembly and they be happy to oblige. False sense of security is worse than lack of security, I’d recommend not to use this attribute.
Comments
- Anonymous
September 17, 2014
It reminds me of the Evil Bit (en.wikipedia.org/.../Evil_bit). Maybe non-technical stakeholders freaked out when they learned about ildasm and pushed for a way to "prevent" it without understanding the truth of the matter.