Skip to content

Improve exception message when loading an empty assembly #36814

@svick

Description

@svick

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?

Metadata

Metadata

Labels

area-AssemblyLoader-coreclrhelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is merged

Type

No type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions