Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: dotnet command not found in GitHub Codespace instance #7986

Open
kbhpe opened this issue Jul 18, 2024 · 4 comments
Open

Error: dotnet command not found in GitHub Codespace instance #7986

kbhpe opened this issue Jul 18, 2024 · 4 comments

Comments

@kbhpe
Copy link

kbhpe commented Jul 18, 2024

During exercise step "Build and run the web app" in Exercise - Get the sample application (https://learn.microsoft.com/en-us/training/modules/create-a-build-pipeline/) while running dotnet build --configuration Release receiving error "command not found".

@mplac555
Copy link

mplac555 commented Aug 2, 2024

Hey! Where you able to figure this out?

DISCLAIMER: Though I'm working in getting better, I'm currently really an IT noob when it comes to advanced stuff like this, so I exhort anyone who sees this who is more knowledgeable in these topics than me to confirm or correct this answer !!

I was also following the instructions from the Exercise - Get the sample application of the Create a build pipeline with Azure Pipelines lesson, and encountered the same error.

I solved this problem in my particular scenario by performing the following actions:

First, I followed the steps to install .NET on Linux, explained in this Microsoft Documentation post; specifically, I chose the scripted install path.

This post tells you to execute the following bash commands in the Codespaces terminal:

wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --version latest

Again, each command is properly explained and justified in the mentioned documentation

The previous series of commands effectively install the latest .NET SDK, after which it's necessary to add dotnet to the system PATH. To do that, I executed the following commands, which I got from this other Ms post:

export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools

Then, I got an error stating something like the following:

Process terminated. Couldn't find a valid ICU package installed on the system. Please install libicu (or icu-libs) using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. Please see https://aka.ms/dotnet-missing-1ibicu for more information.

I solved this by executing the following command, as proposed by the user nt86 in this Stackoverflow post:

export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1

After this, I was able to execute the instructions that needed the dotnet command !

As I commented in the disclaimer above, I'm not an expert an therefore I'm not sure of all the repercussions of this last command, so beware. Also, by the way, I did everything I mentioned in the desktop version of VS Code (on Windows 10), rather than directly on the browser.

This is the first time I try and help in a forum, so I'd appreciate any sort of feedback! :)

@tinybitofheaven
Copy link

tinybitofheaven commented Sep 5, 2024

@mplac555's solution worked for me! However, to get the rest of the steps to work, I had to specify version 6.0 instead of the latest version.

./dotnet-install.sh --channel 6.0

@arelben
Copy link

arelben commented Oct 24, 2024

Thanks @mplac555, your solution works great. But now, when I try to open the web project on port 5000 It shows "Page not found"

@cjjdavies
Copy link

Great solution @mplac555 - this worked for me also. However I have the same issue as @arelben: port 5000 shows "not found".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants