The .NET Core SDK cannot be located (Create a build pipeline with Azure Pipelines)

David Wilkinson 0 Reputation points
2024-07-11T12:42:37.5466667+00:00

When working through the training exercise:https://learn.microsoft.com/en-us/training/modules/create-a-build-pipeline/3-build-locally?pivots=github-codespaces-agentSet up Codespaces; step 2 - Wait for your Codespace to build:

I get the following error:

The .NET Core SDK cannot be located: Error running dotnet --info: Error: Command failed: dotnet --info /bin/sh: dotnet: not found /bin/sh: dotnet: not found . .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path.This prevents me from Building and running the Web App?

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,288 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Pradeep M 1,715 Reputation points Microsoft Vendor
    2024-07-12T04:48:52.78+00:00

    Hi David Wilkinson,

    Thank you for reaching out to Microsoft Q & A forum.    

    The above error suggests that the .NET Core SDK is not installed or not correctly configured in your Codespace environment. To resolve this issue, please follow these steps: 

    1.Install the .NET Core SDK: 

    Open the terminal in your Codespace. 

    Run the following commands to install the .NET Core SDK: 

    sudo apt-get update
    sudo apt-get install -y dotnet-sdk-6.0
    
    

    Ensure that the version number (6.0) matches the version required for your project. If a different version is needed, adjust accordingly. 

    2.Verify the Installation: 

    After installing the SDK, verify the installation by running: 

    dotnet --info
    
    

    This command should display information about the installed .NET Core SDK. 

    3.Set the Path (if necessary): 

    If the SDK is installed but still not recognized, you might need to add it to your PATH. Add the following line to your .bashrc or .zshrc file: 

    export PATH=$PATH:/usr/share/dotnet
    
    

    Reload the terminal or run source ~/.bashrc or source ~/.zshrc to apply the changes. 

    4.Retry the Build: 

    Once the .NET Core SDK is installed and recognized, retry building and running the web app with the following commands: 

    dotnet build --configuration Release
    dotnet run --configuration Release --no-build --project Tailspin.SpaceGame.Web
    
    

    Following these steps should resolve the error and allow you to build and run the web app successfully in your Codespace. If the issue persists, please provide any additional error messages for further assistance.    

    If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.        

    Thank you. 

    0 comments No comments

  2. David Wilkinson 0 Reputation points
    2024-07-15T09:16:17.8833333+00:00

    Problem still not resolved: See responses below from running commands:

    @DaveW07 ➜ /workspaces/mslearn-tailspin-spacegame-web (main) $ sudo apt-get update

    sudo apt-get install -y dotnet-sdk-6.0

    sudo: apt-get: command not found

    sudo: apt-get: command not found

    @DaveW07 ➜ /workspaces/mslearn-tailspin-spacegame-web (main) $ dotnet --info

    bash: dotnet: command not found

    @DaveW07 ➜ /workspaces/mslearn-tailspin-spacegame-web (main) $ export PATH=$PATH:/usr/share/dotnet

    @DaveW07 ➜ /workspaces/mslearn-tailspin-spacegame-web (main) $

    On restarting terminal i get the following output:

    he .NET Core SDK cannot be located: Error running dotnet --info: Error: Command failed: dotnet --info
    /bin/sh: dotnet: not found
    
    
    /bin/sh: dotnet: not found
    . .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path.
    Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime
    Error running dotnet --info: Error: Command failed: dotnet --info
    /bin/sh: dotnet: not found
    
    
    /bin/sh: dotnet: not found
    
    Dotnet path: /home/vscode/.vscode-remote/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.7~x64/dotnet
    Activating C# + C# Dev Kit...
    waiting for named pipe information from server...
    [stderr] Process terminated. [stderr] 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-libicu for more information.[stderr] 
    [stderr]    at System.Environment.FailFast(System.String)
       at System.Globalization.GlobalizationMode+Settings..cctor()
       at System.Resources.ManifestBasedResourceGroveler.GetNeutralResourcesLanguage(System.Reflection.Assembly, System.Resources.UltimateResourceFallbackLocation ByRef)
       at System.Resources.ResourceManager.CommonAssemblyInit()
       at System.CommandLine.Properties.Resources.get_ResourceManager()
       at System.CommandLine.Properties.Resources.get_HelpOptionDescription()
       at System.CommandLine.Help.HelpOption..ctor(System.String, System.String[])
       at System.CommandLine.CliRootCommand..ctor(System.String)
       at Program.<<Main>$>g__CreateCommandLineParser|0_1()
       at Program+<<Main>$>d__0.MoveNext()
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Program+<<Main>$>d__0, Microsoft.CodeAnalysis.LanguageServer, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<Main>$>d__0 ByRef)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Program+<<Main>$>d__0, Microsoft.CodeAnalysis.LanguageServer, Version=4.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<Main>$>d__0 ByRef)
       at Program.<Main>$(System.String[])
       at Program.<Main>(System.String[])
    Language server process exited with null
    [Error - 9:14:53 AM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
    Error: Timeout. Client cound not connect to server via named pipe
        at Function.<anonymous> (/home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.34.12-alpine-x64/dist/extension.js:2:1295226)
        at Generator.next (<anonymous>)
        at s (/home/vscode/.vscode-remote/extensions/ms-dotnettools.csharp-2.34.12-alpine-x64/dist/extension.js:2:1284321)