nunit-console icon indicating copy to clipboard operation
nunit-console copied to clipboard

Proposal: improve error "Unable to load one or more of the requested types."

Open 304NotModified opened this issue 7 years ago • 3 comments

Please improve the error message for the error "Unable to load one or more of the requested types."

Improvements:

  • make clear in the output that it's running x86 of x64
  • suggest to run --x86 or --x64

From: https://github.com/nunit/nunit-console/issues/241

possible related, but not the same issue I think: #444, #315

304NotModified avatar Jul 31 '18 13:07 304NotModified

The "Unable to load..." message could arise for many causes, so it wouldn't be correct to recommend running as x86 without some other information or analysis.

I agree that we should display the bigness if possible. The trick will be to figure out how to handle multiple assemblies, which may have different bitness.

What would we need to consider in order to determine that the bitness is causing a problem?

CharliePoole avatar Jul 31 '18 14:07 CharliePoole

The "Unable to load..." message could arise for many causes, so it wouldn't be correct to recommend running as x86 without some other information or analysis.

true

What would we need to consider in order to determine that the bitness is causing a problem?

I was thinking:

  1. detect for every DLL (or involved) DLL the bitness
  2. if there is a loadedException, compare the bitness with the other involved DLLs
  3. if there are different, write an additional warning.

But the more simple way would be:

if there is a loadedException, explicitly print the current bitness setting of NUnit

304NotModified avatar Aug 01 '18 20:08 304NotModified

More precisely, you would want the bitness of the process running the test that failed to load. The NUnit process itself (assuming separate processes) isn't really relevant.

CharliePoole avatar Aug 01 '18 22:08 CharliePoole