【问题标题】:Build of a ASP.NET Core RC2 project fails on Visual Studio Team Services在 Visual Studio Team Services 上构建 ASP.NET Core RC2 项目失败
【发布时间】:2016-05-24 23:33:56
【问题描述】:

我在 Visual Studio Team Services 中有一个使用 Git 托管的 ASP.NET Core RC2 项目。

当我尝试在 Build vNext 中使用 Visual Studio Build 任务进行构建时,我收到以下错误“导入的项目“C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\ Microsoft.DotNet.Props" 未找到。请确认声明中的路径正确,并且该文件存在于磁盘上。"

我可以使用 VS2015 和 .Net Core SDK RC2 在本地构建。

有没有办法将 Asp.Net 核心 RC2 SDK 安装到托管代理 - 我真的不想创建自定义的。

任何人都知道 .Net Core RC2 SDK 何时会添加构建代理,或者甚至可以在哪里查找该信息。

谢谢。

【问题讨论】:

  • 以后请使用正确的标签!当您的问题与 ASP.NET Core 相关时,请使用“asp.net-core”标签!不是“asp.net”和“core”,两者都与您的问题完全无关。添加前请阅读标签说明

标签: build asp.net-core azure-devops


【解决方案1】:

很遗憾,您必须使用 Visual Studio 2015 Update 2 和最新的 dotnet 工具创建自己的私有代理。该团队将 .NET Core 1 RC2 视为预发布软件,并且通常不会在托管代理映像上安装预发布软件。

【讨论】:

  • 可以理解但令人沮丧,因为 beta8 和 rc1 都可以在 Build vNext 上构建和部署。
  • 这里有一个很好的指南来创建您自己的代理。 nkdagility.com/configure-a-build-vnext-agent-on-vso 不要从你的下载文件夹运行代理安装,你会遇到很多权限问题,安装前移动到 c:\agent 之类的地方。
  • Donovan Brown (Microsoft) 的博文,包含更多信息 donovanbrown.com/post/2016/05/17/…
  • 他们并不真正认为它是预发布软件。来自the Roadmap 的引述:“11 月和 5 月的候选版本(RC1 和 RC2)得到支持,并且可以生产就绪的跨平台版本。”
【解决方案2】:

您可以在构建定义中添加 PowerShell 脚本任务,以安装 Asp.Net Core 项目所需的运行时。

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

详情请参考此链接:Build and Deploy your ASP.NET 5 Application to an Azure Web App

【讨论】:

    猜你喜欢
    • 2017-11-26
    • 1970-01-01
    • 1970-01-01
    • 2015-04-15
    • 2013-12-14
    • 2016-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多