Search code examples
.netmonoasp.net-corednvm

dnvm install Mono


I've trying to build a Docker image that installs mono and runs a .NET app.

I'm basically following the standard guidelines on how to build a Docker image for ASP .NET 5, but want to use Mono as the native host instead (so I can leverage non-CoreCLR dlls).

However, out of the gate, this fails:

D:\>dnvm install mono410
Downloading dnx-clr-win-x86.mono410 from https://www.nuget.org/api/v2
Unable to download package: The remote server returned an error: (400) Bad Request.
At C:\Users\user.dnx\bin\dnvm.ps1:560 char:13
+             throw "Unable to download package: {0}" -f $Global:downloadData.Erro ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Unable to downl...0) Bad Request.:String) [], RuntimeException
    + FullyQualifiedErrorId : Unable to download package: The remote server returned an error: (400) Bad Request.


D:\>dnvm install mono402
Downloading dnx-clr-win-x86.mono402 from https://www.nuget.org/api/v2
Unable to download package: The remote server returned an error: (400) Bad Request.
At C:\Users\user\.dnx\bin\dnvm.ps1:560 char:13
+             throw "Unable to download package: {0}" -f $Global:downloadData.Erro ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Unable to downl...0) Bad Request.:String) [], RuntimeException
    + FullyQualifiedErrorId : Unable to download package: The remote server returned an error: (400) Bad Request.

As you can see I tried two different versions of Mono, so I don't think it's version specific...

What am I doing wrong?

UPDATE:

C:\Program Files (x86)\Mono\bin>dnvm upgrade -r mono
Invoke-Command : Cannot validate argument on parameter 'Runtime'. The argument "mono" does not belong to the set ",clr,coreclr" specified
by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.At
C:\Users\jnevins\.dnx\bin\dnvm.ps1:1487 char:9
+         Invoke-Command ([ScriptBlock]::Create("dnvm-$cmd $cmdargs"))
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Invoke-Command], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand


C:\Program Files (x86)\Mono\bin>dnvm install -r mono
Invoke-Command : Cannot validate argument on parameter 'Runtime'. The argument "mono" does not belong to the set ",clr,coreclr" specified
by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.At
C:\Users\jnevins\.dnx\bin\dnvm.ps1:1487 char:9
+         Invoke-Command ([ScriptBlock]::Create("dnvm-$cmd $cmdargs"))
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Invoke-Command], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand


C:\Program Files (x86)\Mono\bin>

Solution

  • mono410 is not an accepted value for install. What are you trying to do?

    Also, make sure you have mono installed because the command above only brings dnx for Mono, not Mono itself.

    However, because you are running on Windows, it is not possible to install the mono runtime using dnvm. We already have an item tracking this and the PR is out for review. It will probably be merged very soon.