Based on dotnet/roslyn#39470, a relatively common issue when working with dynamically generated assemblies is that, due to a bug in your code, you attempt to load an empty assembly (e.g., you call Assembly.Load(Stream) with a Stream of Length 0). When this happens, you get a correct, but not particularly helpful exception:
System.BadImageFormatException: Bad IL format.
Would it make sense to improve the exception message, to make it more clear what the issue is?
Based on dotnet/roslyn#39470, a relatively common issue when working with dynamically generated assemblies is that, due to a bug in your code, you attempt to load an empty assembly (e.g., you call
Assembly.Load(Stream)with aStreamofLength0). When this happens, you get a correct, but not particularly helpful exception:Would it make sense to improve the exception message, to make it more clear what the issue is?