CI 在 Visual Studio 团队服务中构建失败(Visual Studio 在线)- dnvm 问题?
CI build fails in Visual Studio Team Services (was Visual Studio Online) - dnvm issue?
我正在尝试在 Visual Studio Team Services(Visual Studio 在线)中设置构建定义 (visual studio),但出现以下错误:
C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\DNX\Microsoft.DNX.targets(126,5):
Error : The Dnx Runtime package needs to be installed. See output
window for more details.
我尝试添加一个 Command Line pre-build step
将 运行 dnvm upgrade
但它仍然不起作用。我也试过 dnvm install 1.0.0-rc1-final -r clr -arch x86
没有成功。
该项目只是一个空的网络应用程序模板。
我还应该提到,我对这个工具链还很陌生,我意识到我可能遗漏了一两步。谢谢。
编辑:
我尝试了 (dnvm 升级)提出的解决方案,但它没有用,并且产生了一堆错误(这正是我可以放入 ss 的):
see errors here。我应该补充一点,我无法 运行 dnu restore
因为显然它不被识别为命令。
此外,我发现这没有按预期工作很奇怪,因为这是您可以设置的最基本的操作。
您可以创建一个 power-shell 脚本来安装 dnx 运行-time 并恢复 dnu 包。
# bootstrap DNVM into this session.
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}
# load up the global.json so we can find the DNX version
$globalJson = Get-Content -Path $PSScriptRoot\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore
if($globalJson)
{
$dnxVersion = $globalJson.sdk.version
}
else
{
Write-Warning "Unable to locate global.json to determine using 'latest'"
$dnxVersion = "latest"
}
# install DNX
# only installs the default (x86, clr) runtime of the framework.
# If you need additional architectures or runtimes you should add additional calls
# ex: & $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -r coreclr
& $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -Persistent
# run DNU restore on all project.json files in the src folder including 2>1 to redirect stderr to stdout for badly behaved tools
Get-ChildItem -Path $PSScriptRoot\src -Filter project.json -Recurse | ForEach-Object { & dnu restore $_.FullName 2>1 }
详见本link中power-shell部分:Build and Deploy your ASP.NET 5 Application to an Azure Web App
我正在尝试在 Visual Studio Team Services(Visual Studio 在线)中设置构建定义 (visual studio),但出现以下错误:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DNX\Microsoft.DNX.targets(126,5): Error : The Dnx Runtime package needs to be installed. See output window for more details.
我尝试添加一个 Command Line pre-build step
将 运行 dnvm upgrade
但它仍然不起作用。我也试过 dnvm install 1.0.0-rc1-final -r clr -arch x86
没有成功。
该项目只是一个空的网络应用程序模板。
我还应该提到,我对这个工具链还很陌生,我意识到我可能遗漏了一两步。谢谢。
编辑:
我尝试了 dnu restore
因为显然它不被识别为命令。
此外,我发现这没有按预期工作很奇怪,因为这是您可以设置的最基本的操作。
您可以创建一个 power-shell 脚本来安装 dnx 运行-time 并恢复 dnu 包。
# bootstrap DNVM into this session.
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}
# load up the global.json so we can find the DNX version
$globalJson = Get-Content -Path $PSScriptRoot\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore
if($globalJson)
{
$dnxVersion = $globalJson.sdk.version
}
else
{
Write-Warning "Unable to locate global.json to determine using 'latest'"
$dnxVersion = "latest"
}
# install DNX
# only installs the default (x86, clr) runtime of the framework.
# If you need additional architectures or runtimes you should add additional calls
# ex: & $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -r coreclr
& $env:USERPROFILE\.dnx\bin\dnvm install $dnxVersion -Persistent
# run DNU restore on all project.json files in the src folder including 2>1 to redirect stderr to stdout for badly behaved tools
Get-ChildItem -Path $PSScriptRoot\src -Filter project.json -Recurse | ForEach-Object { & dnu restore $_.FullName 2>1 }
详见本link中power-shell部分:Build and Deploy your ASP.NET 5 Application to an Azure Web App