dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.89k stars 4.89k forks source link

Dotnet issue #8943

Closed Anudeep-Akella closed 6 months ago

Anudeep-Akella commented 10 months ago

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.

Anudeep-Akella commented 10 months ago

Operating System: Ubuntu version 20.04

Anudeep-Akella commented 10 months ago

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]

mairaw commented 10 months ago

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

Anudeep-Akella commented 10 months ago

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

Welcome to .NET 8.0!

SDK Version: 8.0.100

Telemetry

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


Write your first app: https://aka.ms/dotnet-hello-world Find out what's new: https://aka.ms/dotnet-whats-new Explore documentation: https://aka.ms/dotnet-docs Report issues and find source on GitHub: https://github.com/dotnet/core Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli

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'

mairaw commented 10 months ago

@leecow @NikolaMilosavljevic who can help with install issues like this?

Anudeep-Akella commented 10 months ago

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.

leecow commented 10 months ago

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.

Anudeep-Akella commented 10 months ago

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'

Anudeep-Akella commented 10 months ago

Hlo, Do you mind telling me how to setup all the Enviroment and global variables for dotnet.

rzikm commented 10 months ago

The output from dotnet --info suggests it is still using the snap installation. Can you try uninstalling the snap version of dotnet first?

Anudeep-Akella commented 10 months ago

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'
rzikm commented 10 months ago

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?

mairaw commented 7 months ago

@nkolev92 can you please advise here?

nkolev92 commented 7 months ago

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.