0

我正在尝试构建一个安装单声道并运行 .NET 应用程序的 Docker 映像。

我基本上遵循有关如何为 ASP .NET 5 构建 Docker 映像的标准指南,但想使用 Mono 作为本机主机(这样我就可以利用非 CoreCLR dll)。

然而,走出大门,这失败了:

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.

如您所见,我尝试了两个不同版本的 Mono,所以我认为它不是特定于版本的...

我究竟做错了什么?

更新:

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>
4

1 回答 1

1

mono410不是安装的可接受值。你想做什么?

另外,请确保您安装了单声道,因为上面的命令只dnx为 Mono 带来,而不是 Mono 本身。

但是,由于您在 Windows 上运行,因此无法使用dnvm. 我们已经有一个跟踪这个的项目,并且PR 正在接受审查。它可能很快就会被合并。

于 2015-07-22T15:55:12.577 回答