core icon indicating copy to clipboard operation
core copied to clipboard

Dotnet issue

Open Anudeep-Akella opened this issue 2 years ago • 14 comments
trafficstars

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 avatar Nov 20 '23 16:11 Anudeep-Akella

Operating System: Ubuntu version 20.04

Anudeep-Akella avatar Nov 20 '23 16:11 Anudeep-Akella

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]

Anudeep-Akella avatar Nov 20 '23 16:11 Anudeep-Akella

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

mairaw avatar Nov 21 '23 00:11 mairaw

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'

Anudeep-Akella avatar Nov 21 '23 16:11 Anudeep-Akella

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

mairaw avatar Nov 22 '23 01:11 mairaw

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.

Anudeep-Akella avatar Nov 22 '23 13:11 Anudeep-Akella

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.

  • confirm the Snap installed .NET is gone by running snap list in a terminal. Make sure 'dotnet' anything is not listed.
  • run dotnet --info and share the entire output.
  • try dotnet new console in a different directory. (want to make sure you're not re-using what was started with the Snap installed .NET)

leecow avatar Nov 22 '23 19:11 leecow

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 avatar Nov 23 '23 13:11 Anudeep-Akella

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

Anudeep-Akella avatar Nov 25 '23 13:11 Anudeep-Akella

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

rzikm avatar Nov 27 '23 09:11 rzikm

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'

Anudeep-Akella avatar Nov 27 '23 14:11 Anudeep-Akella

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?

rzikm avatar Nov 28 '23 09:11 rzikm

@nkolev92 can you please advise here?

mairaw avatar Feb 14 '24 05:02 mairaw

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.

nkolev92 avatar Feb 14 '24 20:02 nkolev92