Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

613
Views
Getting "Did you mean to run dotnet SDK commands? Please install dotnet SDK from"

I am trying to containerize a .net MVC application, but when I run the image am getting the error like below

user@tuser:~/sam/WebApp$ docker run -p 8000:80 sam:latest

Did you mean to run dotnet SDK commands? Please install dotnet SDK from: https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

user@user:~/sam/WebApp$

And my Dockerfile looks like

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
COPY /bin/Release/Publish /app
ENTRYPOINT ["dotnet", "WebApp.dll"]

Where am I going wrong?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Late answer, but pretty common issue so I'll answer it.

This usually happens if the dll targeting argument in your entrypoint doesn't exist. There are other possibilities if you're exporting, tar-ing and reimporting assets, but that's probably not what we're dealing with here.

In your case, the copy operation is pointing at a root relative file location. I assume that you're not publishing to {system root/}bin/Release/Publish, and your dockerfile is located in the root of your project.

To solve this, you should perform copy operations relative to the directory your dockerfile is in, and specify copy operations using a directory relative path (./etc).

Example that works from my testing:

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
COPY ./bin/Release/Publish /app
ENTRYPOINT ["dotnet", "WebApi.dll"]

To see if it works, examine the resulting container by launching with a cmd override:

docker run -it --rm sam:latest /bin/sh
...
pwd #ensure workdir is app
ls -la #ensure that your application is copied here

If you want to investigate deeper, you can use docker run to override your entrypoint and experiment with different launch configurations to see the output. The commands you'll need are as follows:

docker run -it --rm --entrypoint {dotnet executable} {image}:{tag} {non-existent dll}

Example of output when targeting a non-existent dll via override on an otherwise working container:

➜ docker run -it --rm --entrypoint dotnet sam:latest weebles.dll
Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
  https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!