runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Improve error message on missing dll in dotnet runtime

Open nicolaigj opened this issue 7 years ago • 4 comments

Improve error message on missing dll in dotnet runtime

General

Trying to run dotnet Some.NonExistent.dll with just the dotnet runtime produces a misleading error message telling us that we're missing the SDK instead of telling us that the file is missing. Could the runtime display the same error message as the SDK?

The situation was that we had a tiny spelling error in the script running the app in a docker container, and it wasn't at all apparent that we had misspelled the dll name, spent a fair amount of time trying to figure out what was wrong.

Steps to reproduce

Example using the docker dotnet runtime image:

PS C:\> docker pull mcr.microsoft.com/dotnet/core/runtime:3.0
PS C:\> docker run -it --entrypoint /bin/bash mcr.microsoft.com/dotnet/core/runtime:3.0
root@6f87t213c05f:/# dotnet Some.NonExistent.dll
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download

Expected behavior

I would be great that the runtime had the same behavior as the SDK. Running this on my local machine I get an error message I can understand.

PS C:\> dotnet Some.NonExistent.dll
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET Core program, but dotnet-Some.NonExistent.dll does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

nicolaigj avatar Oct 11 '19 14:10 nicolaigj

@MichaelSimons any idea what's going on here?

scalablecory avatar Oct 11 '19 20:10 scalablecory

@scalablecory - this is not docker specific issue rather it is a question with the dotnet host. I'd suggest moving it to https://github.com/dotnet/core-setup. This looks similar to https://github.com/dotnet/core-setup/issues/3490.

MichaelSimons avatar Oct 14 '19 13:10 MichaelSimons

/cc @elinor-fung

vitek-karas avatar Oct 31 '19 04:10 vitek-karas

Tracked through dotnet/runtime#2980

elinor-fung avatar Nov 21 '19 18:11 elinor-fung