vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Why do you always fail to donwload with new version 2.0

Open heartacker opened this issue 1 year ago • 58 comments

1691029846725.png

heartacker avatar Aug 03 '23 02:08 heartacker

Hi @heartacker can I assume based on the dialog you are in mainland China region?

See https://github.com/microsoft/vscode-dotnettools/issues/186 where we had one other report. We’ve been unable to reproduce this.

timheuer avatar Aug 03 '23 03:08 timheuer

i have install the runtime,why do you always try to down load again and again

why not use the installed version

heartacker avatar Aug 03 '23 04:08 heartacker

@heartacker as a temporary workaround, would you be able to try setting the dotnet.dotnetPath option to point to the folder containing your installed version? For example for me it would be C:\Program Files\dotnet? I believe that should allow the server to start even if the specific runtime isn't able to be acquired.

dibarbet avatar Aug 03 '23 17:08 dibarbet

re @dibarbet 's comment: image

nagilson avatar Aug 03 '23 17:08 nagilson

@dibarbet Your suggestion did not work for me, but it did lead me to a solution. In whichever settings file is appropriate for you

"dotnetAcquisitionExtension.existingDotnetPath": [
  {
    "extensionId": "ms-dotnettools.csharp",
    "path": "C:\\Program Files\\dotnet\\dotnet.exe"
  }
]

acarroll-trend avatar Aug 03 '23 19:08 acarroll-trend

Hi @heartacker we've been checking with our edge delivery teams and we're just not seeing widespread indicators here. I know it's asking a lot but can you help provide us with more information so our network partners can troubleshoot some more? I appreciate it.

Instructions:

  1. Public IP (visit https://ipinfo.io/)
  2. HAR file while the issue occurs
  3. MTR (100 count) to "dotnetcli.azureedge.net" (excluding quotations)
  4. Visit/provide us the results from http://wpc.2dcc.edgecastcdn.net/002DCC/n2/
  5. Visit/provide us the results from https://tools.vdms.com/

We've additionally included steps on how to obtain a HAR/MTR below should the end user require assistance to the ask above. This information would help our team greatly towards our efforts in investigating the report.

Below are the steps for collecting HAR/MTR


HAR file : Here is a guide from Google support, explaining how to use the developer tools to capture the full log of the interaction. https://support.google.com/admanager/answer/10358597?hl=en

MTR: Download and install WinMTR: Visit the WinMTR website (https://sourceforge.net/projects/winmtr/) and download the latest version of WinMTR suitable for your operating system. Launch WinMTR: After installation, open WinMTR from the location where it was installed. Enter the target destination: In the "Host" field, enter the IP address or domain name of the destination you want to test. For example, you can enter a website URL or an IP address , the domain name portion of the URL of the site where you are seeing 504 errors. Start the test: Click on the "Start" or "Start/Stop" button to begin the test. WinMTR will start sending packets to the destination and collect data about each network hop along the way. Copy the data or send a screenshot of the MTR to help us diagnose what server may be returning that code.


timheuer avatar Aug 03 '23 23:08 timheuer

I have tried this "dotnetAcquisitionExtension.existingDotnetPath": [ { "extensionId": "ms-dotnettools.csharp", "path": "C:\Program Files\dotnet\dotnet.exe" } ] as @dibarbet said , nothing is working .

Felexonyango avatar Aug 05 '23 10:08 Felexonyango

The problem I'm having is that the installation is not completing due to group policy limiting PS1 file execution but even installing 7.0.9 runtime manually resolve the issue, it still attempts to install.

Setting the path manually in the settings file causes the extension to basically disable. The omnisharp status and selected project do not appear in the status bar after setting the path.

cmargroff avatar Aug 05 '23 15:08 cmargroff

Setting the path manually in the settings file causes the extension to basically disable. The omnisharp status and selected project do not appear in the status bar after setting the path.

@cmargroff I wouldn't expect you to see specific OmniSharp status unless you've followed this: https://github.com/dotnet/vscode-csharp#how-to-use-omnisharp?

timheuer avatar Aug 05 '23 23:08 timheuer

Same problem here, I am having problem acquiring the .net version 7.0.9 in a proxied environment in a client, as I can not do anything besides opening a ticket to solve the proxy issue, I was trying to disable the Downloading of this new .Net Runtime version and use one of the versions I already have.

But, setting the version using the latest one I have 7.0.306 with the recommended settings make the extensions being disabled or stuck:

when I set in my settings.json:

"dotnetAcquisitionExtension.existingDotnetPath": [
  {
    "extensionId": "ms-dotnettools.csharp",
    "path": "/home/user/.dotnet/dotnet"
  }
]

I receive the following output from the .Net Runtime:

Downloading the .Net Runtime.
Using configured .Net path: /home/user/.dotnet/dotnet

And nothing happens, the extension stop to works.

coderade avatar Aug 07 '23 15:08 coderade

But, setting the version using the latest one I have 7.0.306 with the recommended settings make the extensions being disabled or stuck:

Can you share the output of the C# log (with the dotnet.server.trace setting to Trace if possible)? It's possible you're encountering a project load issue.

dibarbet avatar Aug 07 '23 17:08 dibarbet

Thanks for the reply @dibarbet. Unfortunately, even with the following options in my settings.json file:

"dotnetAcquisitionExtension.existingDotnetPath": [
 {
   "extensionId": "ms-dotnettools.csharp",
   "path": "/home/user/.dotnet/dotnet"
 }
]
"razor.trace": "Verbose",
"dotnet.server.trace": "Trace"

I do not see any changes on the .Net runtime output:

Downloading the .Net Runtime.
Using configured .Net path: /home/user/.dotnet/dotnet

coderade avatar Aug 07 '23 18:08 coderade

@coderade Please attach the log that @dibarbet had suggested. The output is telling you that it is using your custom path, so it did change the behavior and output. The output you showed is not trying to acquire dotnet anymore. What is the problem you are experiencing? I'm guessing it may be an issue of the C# Extension to pick up this configured dotnet path if you are still experiencing an issue.

nagilson avatar Aug 07 '23 18:08 nagilson

Specifically, I'm looking for these logs from the output window image

dibarbet avatar Aug 07 '23 18:08 dibarbet

@dibarbet https://github.com/dotnet/vscode-csharp/issues/6029#issuecomment-1665996087 Does it mean I need to download every update? .net7? .net 8? I just want to use a fixed version of the runtime to work, why do I need to download every?

forfcw avatar Aug 08 '23 03:08 forfcw

image image

@dibarbet even installing 7.0.9 runtime manually resolve the issue, it still attempts to download everytime.

Jss-Jss avatar Aug 08 '23 03:08 Jss-Jss

image image

@dibarbet even installing 7.0.9 runtime manually resolve the issue, it still attempts to download everytime.

@nagilson this seems unexpected right? It looks like it found the dotnet path from the option, but its still downloading the runtime

dibarbet avatar Aug 08 '23 05:08 dibarbet

Does it mean I need to download every update? .net7? .net 8?

The server is currently fixed on the .net7 runtime. It is likely we'll eventually update it to the .net 8 runtime, but not on every preview release for example. Generally we will continue to (slowly) update the server runtime to pick up important bug fixes, perf improvements and security fixes.

dibarbet avatar Aug 08 '23 05:08 dibarbet

Does it mean I need to download every update? .net7? .net 8?

The server is currently fixed on the .net7 runtime. It is likely we'll eventually update it to the .net 8 runtime, but not on every preview release for example. Generally we will continue to (slowly) update the server runtime to pick up important bug fixes, perf improvements and security fixes.

So the result is that if I don't choose to upgrade, this error will pop up every time I load cs project. This doesn't seem very friendly, at least there's no way to close it.

forfcw avatar Aug 08 '23 07:08 forfcw

I got rid of this by setting the dotnet.dotnetPath in the settings.json file

"dotnet.dotnetPath": "/usr/local/share/dotnet",

elliotrask avatar Aug 08 '23 12:08 elliotrask

For me checking the logs it is working after setting:

"dotnetAcquisitionExtension.existingDotnetPath": [
  {
    "extensionId": "ms-dotnettools.csharp",
    "path": "/home/user/.dotnet/dotnet"
  }
]

Checking the C# logs everything is working properly, but I do not know why but the C# support was taking more time to works than the normal, but I think can be something in my machine side. Thanks!

coderade avatar Aug 08 '23 13:08 coderade

Whatever I set, it still tries to download the .net SDK. on Mac

imokoi avatar Aug 09 '23 03:08 imokoi

Also on MacOS 13.4, setting the values below suppressed the download

  "dotnet.dotnetPath": "/usr/local/share/dotnet/",
  "dotnetAcquisitionExtension.existingDotnetPath": [
    {
      "extensionId": "ms-dotnettools.csharp",
      "path": "/usr/local/share/dotnet/"
    }
  ]

But did nothing for code completion or roslyn activation. Unity debugging is still a hopeless endeavor

felipemullen avatar Aug 09 '23 03:08 felipemullen

I got the same issue. I've already installed dotnet7.0.10 at /usr/share/dotnet/ but every time I run vscode it start installing the dotnet, even though I've set the "dotnet.dotnetPath": "/usr/share/dotnet/" as well as

  "dotnetAcquisitionExtension.existingDotnetPath": [
    {
      "extensionId": "ms-dotnettools.csharp",
      "path": "/usr/share/dotnet/"  # I tried /usr/sahre/dotnet/dotnet as well but doesn't seems to work
    }

image

And due to my network connection I guess I keeps getting me this Error:

image

Info :

  • I'm using Linux
  • VsCode latest version
  • DotNet latest version
  • C# ext pre-release version
  • C# devKit pre-release version

moamlrh avatar Aug 09 '23 12:08 moamlrh

For everyone getting the same issue, I've solved it using the following settings (For Linux users) :

  • Make sure you don't have /usr/bin/dotnet link or whatever

  • If you have just remove it sudo rm -rf /usr/bin/dotnet

  • Or check your dotnet path using which dotnet

  • Next Install dotnet (if you haven't already) on whatever path you want (I have installed it on /home/me/.dotnet/

  • Set DOTNET_ROOT variable in ~/.bashrc or ~./.zshrc

  • For me I'm using zsh so I've add this to my .zshrc file :

export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
  • Now time for vscode, you have to edit settings.json file ( CTRL + , ) to open the settings tab

  • Then search fordotnetAcquisitionExtension and click on Edit in settings.json image

  • Add these following lines to settings.json file :

  "dotnetAcquisitionExtension.existingDotnetPath": [
    {
      "extensionId": "ms-dotnettools.csharp",
      "path": "/home/me/.dotnet/dotnet"
    },
    {
      "extensionId": "ms-dotnettools.csdevkit",
      "path": "/home/me/.dotnet/dotnet"
    },
  ],
  • Restart vscode and everything should work just fine

Important

  • vscode version : 1.81.0 which is the latest version atm.

  • C# ext version : image

  • C# devKit ext version (I'm using this extension and I think the issue was here but not sure tho): image

  • DotNet info :

❯ dotnet --info    
.NET SDK:
 Version:   8.0.100-preview.6.23330.14
 Commit:    ba97796b8f

Runtime Environment:
 OS Name:     fedora
 OS Version:  38
 OS Platform: Linux
 Base Path:   /home/me/.dotnet/sdk/8.0.100-preview.6.23330.14/

Environment variables:
  DOTNET_ROOT       [/home/me/.dotnet]

moamlrh avatar Aug 09 '23 13:08 moamlrh

image image @dibarbet even installing 7.0.9 runtime manually resolve the issue, it still attempts to download everytime.

@nagilson this seems unexpected right? It looks like it found the dotnet path from the option, but its still downloading the runtime

It uses promise.resolve() with the given string whenever it outputs 'Using Configured Runtime blah`, so it shouldn't as it would never get to the install code --> but it can be a problem if there are multiple extensions calling with different settings for the existingDotnetPath, or if the user has set it as well as the calling extension to the API. For @Jss-Jss : May you share a list of all of the extensions on your vs code?

nagilson avatar Aug 09 '23 22:08 nagilson

image image @dibarbet even installing 7.0.9 runtime manually resolve the issue, it still attempts to download everytime.

@nagilson this seems unexpected right? It looks like it found the dotnet path from the option, but its still downloading the runtime

It uses promise.resolve() with the given string whenever it outputs 'Using Configured Runtime blah`, so it shouldn't as it would never get to the install code --> but it can be a problem if there are multiple extensions calling with different settings for the existingDotnetPath, or if the user has set it as well as the calling extension to the API. For @Jss-Jss : May you share a list of all of the extensions on your vs code?

image image @nagilson I don't think it was caused by other extensions,I've tried to uninstall and keep only the necessary for Unity,this error still pop everytime。

Jss-Jss avatar Aug 10 '23 03:08 Jss-Jss

I've had enough of this problem. Time 2 return version C# 1.26.0, bye guys.

image image image

MirzkisD1Ex0 avatar Aug 10 '23 08:08 MirzkisD1Ex0

This problem still exists,nothing works "dotnet.dotnetPath": "/usr/local/share/dotnet/", "dotnetAcquisitionExtension.existingDotnetPath": [ { "extensionId": "ms-dotnettools.csharp", "path": "/usr/local/share/dotnet/" } ]

Gary-Lty avatar Aug 10 '23 10:08 Gary-Lty

A solution that worked for me was re-installing the C# extensions along with the .NET Install Tool for Ext. etc. Then from the welcome menu, downloaded the .NET SDK through the C# extension's "Walkthrough" tab. Then, applied "C:\route to dotnet folder\dotnet" to "dotnet.dotnetPath" the .NET Install Tool settings. Hope this helps some. image

ip240Z avatar Aug 10 '23 12:08 ip240Z