0

I'm trying to setup a build definition (visual studio) in Visual Studio Team Services (was Visual Studio Online), and I get the following error:

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.

I tried adding a Command Line pre-build step which would run dnvm upgrade and it still didn't work. I also tried dnvm install 1.0.0-rc1-final -r clr -arch x86 without any success.

The project is just an empty web app template.

Also I should mention that I'm quite new to this toolchain and I realize that probably I'm missing a step or two. Thanks.

EDIT: I tried the solution proposed here (dnvm upgrade) but it didn't work and it generated a bunch of errors (this is just what I could fit in a ss): see errors here. I should add that I wasn't able to run dnu restore because apparently it isn't recognized as a command.

Also I find it odd that this isn't working as expected since it's the most basic operation you could setup.

Community
  • 1
  • 1
sevG
  • 65
  • 5
  • 1
    Duplicate. See http://stackoverflow.com/questions/31957824/the-dnx-runtime-package-needs-to-be-installed-see-output-window-for-more-detail – planetmaker Mar 10 '16 at 11:47

1 Answers1

2

You can create a power-shell script to install the dnx run-time and restore the dnu packages.

# 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 }

Refer to the section for power-shell in this link for details: Build and Deploy your ASP.NET 5 Application to an Azure Web App

Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60