Closed Anudeep-Akella closed 6 months ago
Operating System: Ubuntu version 20.04
Operating System: Ubuntu 20.04 Getting this issue when using dotnet commands.
/snap/dotnet-sdk/228/sdk/8.0.100/NuGet.targets(156,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/user/Myconsole/ConsoleApp1.sln] /snap/dotnet-sdk/228/sdk/8.0.100/NuGet.targets(156,5): error : Request headers must contain only ASCII characters. [/home/user/Myconsole/ConsoleApp1.sln]
I think there are issues with snap installs. I'd try a different installation method: https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu
Thank you for the advice.
Encountering the same error even after deleting and installing the dotnet by following the above link. user@elementary:~$ dotnet new console
SDK Version: 8.0.100
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
Installed an ASP.NET Core HTTPS development certificate. To trust the certificate, view the instructions: https://aka.ms/dotnet-https-linux
An issue was encountered verifying workloads. For more information, run "dotnet workload update". The template "Console App" was created successfully.
Processing post-creation actions... Restoring /home/user/user.csproj: Determining projects to restore... /usr/share/dotnet/sdk/8.0.100/NuGet.targets(156,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/user/user.csproj] /usr/share/dotnet/sdk/8.0.100/NuGet.targets(156,5): error : Request headers must contain only ASCII characters. [/home/user/user.csproj] Restore failed. Post action failed. Manual instructions: Run 'dotnet restore'
@leecow @NikolaMilosavljevic who can help with install issues like this?
Thank you for the suggestion.Do you think the problem is with not setting up the env(Environmental Variable). Also i am new to github how can i ask my problem to the persons directly you mentioned.
I successfully ran things on a new 20.04 machine, so we know it works! :-).
@Anudeep-Akella - a couple of things to help me understand the state of your machine.
snap list
in a terminal. Make sure 'dotnet' anything is not listed. dotnet --info
and share the entire output. dotnet new console
in a different directory. (want to make sure you're not re-using what was started with the Snap installed .NET)Thank you for the advice. I am seeing that the dotnet is listed in the snap list.
This is the output i got after running dotnet --info. user@elementary:~/My$ dotnet --info .NET SDK: Version: 8.0.100 Commit: 57efcf1350 Workload version: 8.0.100-manifests.6c33ef20
Runtime Environment: OS Name: elementary OS Version: 6.1 OS Platform: Linux RID: linux-x64 Base Path: /snap/dotnet-sdk/228/sdk/8.0.100/
.NET workloads installed: Workload version: 8.0.100-manifests.6c33ef20 There are no installed workloads to display.
Host: Version: 8.0.0 Architecture: x64 Commit: 5535e31a71
.NET SDKs installed: 8.0.100 [/snap/dotnet-sdk/228/sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 8.0.0 [/snap/dotnet-sdk/228/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.0 [/snap/dotnet-sdk/228/shared/Microsoft.NETCore.App]
Other architectures found: None
Environment variables: Not set
global.json file: Not found
Learn more: https://aka.ms/dotnet/info
Download .NET: https://aka.ms/dotnet/download
I am still getting the same error even after running the dotnet new console in different directory
An issue was encountered verifying workloads. For more information, run "dotnet workload update". The template "Console App" was created successfully.
Processing post-creation actions... Restoring /home/user/My/user.csproj: Determining projects to restore... /usr/share/dotnet/sdk/8.0.100/NuGet.targets(156,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/user/My/user.csproj] /usr/share/dotnet/sdk/8.0.100/NuGet.targets(156,5): error : Request headers must contain only ASCII characters. [/home/user/My/user.csproj] Restore failed. Post action failed. Manual instructions: Run 'dotnet restore'
Hlo, Do you mind telling me how to setup all the Enviroment and global variables for dotnet.
The output from dotnet --info
suggests it is still using the snap installation. Can you try uninstalling the snap version of dotnet first?
Thank you for the Advice. I uninstalled dotent from snap and installed using sudo apt install dotnet-sdk-8.0.
user@elementary:~$ dotnet --info
.NET SDK:
Version: 8.0.100
Commit: 57efcf1350
Workload version: 8.0.100-manifests.6c33ef20
Runtime Environment:
OS Name: elementary
OS Version: 6.1
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/8.0.100/
.NET workloads installed:
Workload version: 8.0.100-manifests.6c33ef20
There are no installed workloads to display.
Host:
Version: 8.0.0
Architecture: x64
Commit: 5535e31a71
.NET SDKs installed:
8.0.100 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
I am still getting the same result.
user@elementary:~/Myc#$ dotnet new console
The template "Console App" was created successfully.
Processing post-creation actions...
Restoring /home/user/Myc#/Myc#.csproj:
Determining projects to restore...
/usr/share/dotnet/sdk/8.0.100/NuGet.targets(156,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/user/Myc#/Myc#.csproj]
/usr/share/dotnet/sdk/8.0.100/NuGet.targets(156,5): error : Request headers must contain only ASCII characters. [/home/user/Myc#/Myc#.csproj]
Restore failed.
Post action failed.
Manual instructions: Run 'dotnet restore'
I tried to reproduce the issue on the elementary/docker:stable docker image and it does not happen there.
The error message suggests we are trying to send malformed HTTP headers during nuget restore. @nkolev92 Can you please advise for the next steps and transfer the issue if applicalbe?
@nkolev92 can you please advise here?
I'm not sure how that would happen. Don't remember seeing this before. What I'd try doing is increasing the verbosity, and/or using a network inspection tool to figure out what characters are being reported as non ascii.
Problem encountered on https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/run Operating System: linux This is the error message i am getting for when following the tutorial. Activating the "Microsoft.VisualStudio.CpsProjectIconSourceService (0.1)" service failed.