VSTS无法构建我真正非常简单的ASP.NET Core应用 [英] VSTS fails to build my really really simple ASP.NET Core app

查看:84
本文介绍了VSTS无法构建我真正非常简单的ASP.NET Core应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下内容是如此简单,但失败了.怎么了?

The following is so so simply and yet it fails. What's wrong?

  • 我在Visual Studio 2017中创建了一个新的ASP.NET Core Web应用程序(.NET Framework 4.6.2).

  • I create a new ASP.NET Core Web Application (.NET Framework 4.6.2) in Visual Studio 2017.

我没有更改默认模板,而是将其推送到VSTS.

I make no changes to the default template and I push it to VSTS.

我通过以下两个步骤在VSTS中创建新的构建定义:

I create a new build definition in VSTS with the following two steps:

  1. NuGet恢复
  2. Visual Studio构建

  • 我更新了NuGet步骤以使用4.0.0版

  • I update the NuGet step to use version 4.0.0

    我将定义更新为使用Hosted VS2017代理.

    I update the definition to use the Hosted VS2017 agent.

    我使用带有默认MSBuild参数的VS2017离开构建"步骤:

    I leave the Build step using VS2017 with the default MSBuild arguments:

    /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\".

    在以前的版本中,这将为我创建一个Web部署程序包,正是我想要的.

    • 我排队一个新的版本.

    NuGet步骤成功.

    The NuGet step succeeds.

    构建步骤一直运行到记录...

    The build step runs until it logs...

    _TransformWebConfig:

    ...然后...

    未找到web.config.创建'C:\ a \ 1 \ s \ src \ WebApp \ obj \ Release \ net462 \ win7-x86 \ PubTmp \ Out \ web.config'

    No web.config found. Creating 'C:\a\1\s\src\WebApp\obj\Release\net462\win7-x86\PubTmp\Out\web.config'

    ...和...

    Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(124,7):错误MSB4184:无法评估表达式"[[System.IO.Path] :: GetDirectoryName('')".该路径不是合法形式.

    Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(124,7): Error MSB4184: The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form.

    推荐答案

    此问题已修复: https://github.com/aspnet/websdk/issues/106

    在VSTS中使用的示例命令行和语法(ASPNET Core模板应该已经在模板中包含了此示例):

    Sample commandline and syntax to use in VSTS (ASPNET Core templates should already have this in the template): https://github.com/vijayrkn/ASPNetPublishSamples/blob/bff9f78d796668dc07d5e28a8b93531caade839c/Publish.cmd#L102-L127

    这篇关于VSTS无法构建我真正非常简单的ASP.NET Core应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆