-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Description
When you run ilverify to verify a DLL that has dependencies, if some dependency dll is missing ilverify throws:
NullReferenceException at ILVerify.ILVerifyTypeSystemContext.VerifyModuleName(String simpleName, EcmaModule module)
instead of a more helpful exception (such as FileNotFound with the name of the missing file).
That makes incredibly frustrating to verify DLLs with lots of dependencies in several folders (such as Visual Studio extensions) if you miss some folder.
Reproduction Steps
- Using Visual Studio 2022 create a solution with two .NET 6.0 Class Library projects (ClassLibrary1 and ClassLibrary2), with ClassLibrary2 referencing ClassLibrary1.
- In the referenced library (ClassLibrary1), create a static class with a static method.
- In the referencing library (ClassLibrary2), create a class with a method that calls the method in the other library
- Build the solution
- Open a command prompt and change to the output folder of ClassLibrary2 (ClassLibrary2\bin\Debug\net6.0)
- Run the following command:
ilverify ClassLibrary2.dll -r "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.0*.dll"
(notice that we have omitted -r ".*.dll" so that ClassLibrary1.dll will not be found)
Expected behavior
Something like:
"ClassLibrary1.dll not found"
Actual behavior
Error: System.NullReferenceException: Object reference not set to an instance of an object.
at ILVerify.ILVerifyTypeSystemContext.VerifyModuleName(String simpleName, EcmaModule module)
...
Regression?
No response
Known Workarounds
No response
Configuration
.NET 6.0
Windows 10
AnyCPU
Other information
No response