5

I am referring to a bug which is known to Microsoft but ignored. See here for more information. It occurs when there are more than 1024 embedded resources in an assembly. This look like this: Ilasm Error

This problem arises when I use the Dotfuscator to obfuscate the assembly. This tool itself uses the ilasm.exe. Are there any workarounds I can use to avoid this bug?

Yggdrasil
  • 1,377
  • 2
  • 13
  • 27
  • :| you have more than 1024 resource files??? you could compress them as a work around – Aydin May 18 '15 at 08:45
  • I have tun into this problem like 10 years ago and it was resolved by MS patch at that time. Which Framework version and VS you have? – Dusan May 18 '15 at 08:47
  • 1
    It's only a bug if the doco says one thing and the code does another. Otherwise it's a product limitation :-) – paxdiablo May 18 '15 at 08:48
  • I use the framework 4.5.1. I have no idea if the doco says it is restricted to 1024 files. – Yggdrasil May 18 '15 at 09:01
  • 1
    It is a known issue, and it was not fixed in time for 4.5.1: https://connect.microsoft.com/VisualStudio/feedback/details/794084/ilasm-exe-assemble-more-than-1024-resource-files-will-crash - Scroll down for this comment: **This code base is quite old, and hasn't been modified much since it was first written. I'll switch it to use a growable vector for these things instead of this silly fixed-size array. Hopefully I can get it ready for the next available release (we just finished 4.5.1, so I have no idea when that might be).** – Lasse V. Karlsen May 18 '15 at 12:50
  • @LasseV.Karlsen That is why I search for a workaround in the meantime. – Yggdrasil May 18 '15 at 13:00
  • Does the obfuscator produce more resource files? If not then you simply need to reduce the number of resource files to 1024 or less. As is noted in that connect article, Visual Studio and the compilers doesn't use ilasm so they don't have this problem, as such I would look at whether your original unobfuscated projects have that many resource files, if so a workaround would be to reduce the number somehow. Can you split one such assembly into multiple smaller ones? – Lasse V. Karlsen May 18 '15 at 13:21
  • I have thought about putting all resources in one separate assembly and not obfuscating this one. It is a possible workaround although not a nice one. – Yggdrasil May 18 '15 at 13:52

0 Answers0