在VSO中构建ASP.NET 5项目

时间:2015-08-02 11:34:35

标签: visual-studio-2015 asp.net-core tfsbuild azure-devops dnx

我无法让VSO构建ASP.NET 5项目。获得包装似乎存在问题。

在VSO中构建步骤:

VSO Build Steps

我在VS 2015中构建了项目,并选中了“Restore NuGet Packages”。

构建控制台输出:

self.cursor.execute("SELECT * from user_data WHERE Name = %s",('name',))

请注意,这特定于NuGet包还原。请参阅我的答案以获得修复。

1 个答案:

答案 0 :(得分:1)

我使用以下步骤安装DNVM,DNX并为dnu restore中找到的每个project.json文件调用src

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

请参阅this MSDN post