Omnisharp-roslyn: Can't build omnisharp-roslyn for vim on Windows 10

Created on 28 Aug 2017  路  8Comments  路  Source: OmniSharp/omnisharp-roslyn

After running build.ps1 , the script tried to download dotnetCoreSdk but it is already installed

PS C:\Program Files\dotnet\sdk> dir


    Directory: C:\Program Files\dotnet\sdk


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
da----        7/31/2017  11:57 AM                1.0.0
da----        8/13/2017  10:07 AM                1.0.4
da----        8/15/2017   2:03 AM                1.1.0
da----        8/14/2017  11:14 PM                2.0.0
da----        8/12/2017   4:16 PM                2.0.0-preview2-006497
d-----        8/14/2017  11:18 PM                NuGetFallbackFolder

full error log -

PS C:\Users\ratanparai\vimfiles\plugins\bundle\omnisharp-vim\omnisharp-roslyn> .\build.ps1
Preparing to run build script...
Running build script...
Analyzing build script...
Processing build script...
Installing addins...
Compiling build script...
Current platform: Windows (x64)

========================================
Cleanup
========================================
Executing task: Cleanup
Finished executing task: Cleanup

========================================
ValidateMono
========================================
Skipping task: ValidateMono

========================================
InstallDotNetCoreSdk
========================================
Executing task: InstallDotNetCoreSdk
dotnet-install: Downloading https://dotnetcli.azureedge.net/dotnet/Sdk/1.0.4/dotnet-dev-win-x64.1.0.4.zip
Failed to download https://dotnetcli.azureedge.net/dotnet/Sdk/1.0.4/dotnet-dev-win-x64.1.0.4.zip.
At C:\Users\ratanparai\vimfiles\plugins\bundle\omnisharp-vim\omnisharp-roslyn\.dotnet\dotnet-install.ps1:159 char:13
+             throw $ErrorMsg
+             ~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Failed to downl...-x64.1.0.4.zip.:String) [], RuntimeException
    + FullyQualifiedErrorId : Failed to download https://dotnetcli.azureedge.net/dotnet/Sdk/1.0.4/dotnet-dev-win-x64.1.0.4.zip.

An error occurred when executing task 'InstallDotNetCoreSdk'.
Error: Failed to Install .NET Core SDK 1.0.4

All 8 comments

Seems like the download failed rather than it failed because it was already installed. Are you able to download https://dotnetcli.azureedge.net/dotnet/Sdk/1.0.4/dotnet-dev-win-x64.1.0.4.zip directly from a browser?

@DustinCampbell , Yes I can download it manually.

I am having the same issue. And I am also able to download the file from a browser. I get the exact same error.

This is the command running:

"powershell" -NoProfile /Command C:\Users\<omitted>\vimfiles\pack\plugins\start\omnisharp-vim\omnisharp-roslyn\.dotnet\dotnet-install.ps1 -Channel preview -Version 1.0.4 -InstallDir C:\Users\<omitted>\vimfiles\pack\plugins\start\omnisharp-vim\omnisharp-roslyn\.dotnet

Debugging this is what I have found:

This is the executing code:

````powershell
$HttpClient.Timeout = New-TimeSpan -Minutes 5
$Response = $HttpClient.GetAsync($Uri).Result
if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode)))
{
$ErrorMsg = "Failed to download $Uri."
if ($Response -ne $null)
{
$ErrorMsg += " $Response"
}

        throw $ErrorMsg
    }

````

It clearly sets the timeout to 5 minutes. I started downloading the file on the browser, and got an 8 to 9 minutes estimate. The download is timing out. Total execution time for the build.ps1 script is about 5 minutes and 30 seconds, just a bit higher than the 5 minutes limit, because of the other actions performed by it.
Also, by looking at the error message, the response is clearly null. We are not getting http errors, otherwise we would see them in the error message.
I will wait for my manual download to finish, and then try again. Then, maybe the azure edge network may have cached it and the download might be faster. If that does not work I will create a manual proxy with a cache using docker, and cache everything locally. I will post my results later.

Update: I was not able to get the download to be faster, the Azure CDN is not caching it or is just too far from me. And the squid proxy I tried also did not work, but I don't know why. So, at this moment, I can't install because of the timeout.

I have tried changing the timeout value but everytime I run build.ps1 the file get override by new ones with default 5 mins timeout value.

I can't find out how the file is generating or any option to use local download copy of the zip file.

Moreover today I tried to compile omnisharp-roslyn in ubuntu gnome 17.04 but also failed due to dotnet error! I have dotnet core 2.0.0 sdk installed there and can't seem to find a way to install v1 :(

Can anyone help us with this? This has made vim unusable with Roslyn... :(

Have you tried downloading a release instead of compiling? https://github.com/OmniSharp/omnisharp-roslyn/releases

OmniSharp VIM has moved to consume binaries instead of using the submodule approach so I will close this as not applicable anymore.

Was this page helpful?
0 / 5 - 0 ratings