无法使用托管代理在Visual Studio Team Services上构建默认的ASP.Net Core Web应用程序(.NET Core) [英] Unable to build default ASP.Net Core Web Application (.NET Core) on Visual Studio Team Services using Hosted Agent

查看:77
本文介绍了无法使用托管代理在Visual Studio Team Services上构建默认的ASP.Net Core Web应用程序(.NET Core)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已在Visual Studio 2015 Update 3中创建了一个新的ASP.Net Core Web应用程序(.Net Core)项目,并将其签入了Visual Studio Team Services git存储库.我正在使用.Net Core和ASP.Net Core的发行版.

Having created a new ASP.Net Core Web Application (.Net Core) project in Visual Studio 2015 Update 3 and checked this in to a Visual Studio Team Services git repository. I am using the release version of .Net Core and ASP.Net Core.

我现在正尝试使用基于本指南的构建定义使用VSTS Build系统构建此文件:https://www.visualstudio.com/zh-cn/docs/build/apps/aspnet/aspnetcore-to-azure

I am now trying to build this using the VSTS Build system using a build definition based on this guide: https://www.visualstudio.com/en-us/docs/build/apps/aspnet/aspnetcore-to-azure

但是,在dotnet restore步骤上构建失败,并显示以下日志(不包括第一部分,这是从它开始失败的地方开始的.)

However, the build fails on the dotnet restore step with the log shown below (first part not included, this is from where it starts to fail).

我做错了什么?我是否需要以任何方式准备当前的托管代理,以使其能够与ASP.Net Core v1.0.0版本一起使用?

What am I doing wrong? Do I need to prep the current Hosted Agents in any way to get this working with the v1.0.0 release of ASP.Net Core?

2016-07-01T06:58:23.7437947Z log  : Restoring packages for tool 'BundlerMinifier.Core' in C:\a\1\s\src\FjordTours.BasicApp\project.json...
2016-07-01T06:58:23.7457953Z info :   GET https://api.nuget.org/v3-flatcontainer/bundlerminifier.core/index.json
2016-07-01T06:58:24.2167463Z info :   OK https://api.nuget.org/v3-flatcontainer/bundlerminifier.core/index.json 469ms
2016-07-01T06:58:24.2188952Z info :   GET https://api.nuget.org/v3-flatcontainer/bundlerminifier.core/2.0.238/bundlerminifier.core.2.0.238.nupkg
2016-07-01T06:58:24.4460947Z info :   OK https://api.nuget.org/v3-flatcontainer/bundlerminifier.core/2.0.238/bundlerminifier.core.2.0.238.nupkg 226ms
2016-07-01T06:58:24.4500936Z info :   GET https://api.nuget.org/v3-flatcontainer/nuglify/index.json
2016-07-01T06:58:24.7169172Z info :   OK https://api.nuget.org/v3-flatcontainer/nuglify/index.json 266ms
2016-07-01T06:58:24.7184197Z info :   GET https://api.nuget.org/v3-flatcontainer/nuglify/1.5.0/nuglify.1.5.0.nupkg
2016-07-01T06:58:24.9458237Z info :   OK https://api.nuget.org/v3-flatcontainer/nuglify/1.5.0/nuglify.1.5.0.nupkg 226ms
2016-07-01T06:58:25.0165432Z log  : Installing NUglify 1.5.0.
2016-07-01T06:58:25.0175433Z log  : Installing BundlerMinifier.Core 2.0.238.
2016-07-01T06:58:26.3365438Z log  : Restoring packages for tool 'Microsoft.AspNetCore.Razor.Tools' in C:\a\1\s\src\FjordTours.BasicApp\project.json...
2016-07-01T06:58:27.5785417Z error: Package Microsoft.DotNet.ProjectModel.Loader 1.0.0-preview2-003121 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.DotNet.ProjectModel.Loader 1.0.0-preview2-003121 supports: netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:27.5815442Z error: Package Microsoft.DotNet.Cli.Utils 1.0.0-preview2-003121 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.DotNet.Cli.Utils 1.0.0-preview2-003121 supports:
2016-07-01T06:58:27.5815442Z error:   - net451 (.NETFramework,Version=v4.5.1)
2016-07-01T06:58:27.5828217Z error:   - netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:27.5835753Z error: One or more packages are incompatible with .NETCoreApp,Version=v1.0.
2016-07-01T06:58:27.5845450Z log  : Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in C:\a\1\s\src\FjordTours.BasicApp\project.json...
2016-07-01T06:58:27.5855447Z info :   GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.server.iisintegration.tools/index.json
2016-07-01T06:58:27.8429648Z info :   OK https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.server.iisintegration.tools/index.json 257ms
2016-07-01T06:58:27.8452904Z info :   GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.server.iisintegration.tools/1.0.0-preview2-final/microsoft.aspnetcore.server.iisintegration.tools.1.0.0-preview2-final.nupkg
2016-07-01T06:58:28.0722938Z info :   OK https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.server.iisintegration.tools/1.0.0-preview2-final/microsoft.aspnetcore.server.iisintegration.tools.1.0.0-preview2-final.nupkg 226ms
2016-07-01T06:58:28.1392401Z info :   GET https://api.nuget.org/v3-flatcontainer/microsoft.dotnet.projectmodel/index.json
2016-07-01T06:58:28.4376727Z info :   OK https://api.nuget.org/v3-flatcontainer/microsoft.dotnet.projectmodel/index.json 298ms
2016-07-01T06:58:28.4406725Z info :   GET https://api.nuget.org/v3-flatcontainer/microsoft.dotnet.projectmodel/1.0.0-rc3-003121/microsoft.dotnet.projectmodel.1.0.0-rc3-003121.nupkg
2016-07-01T06:58:28.6676393Z info :   OK https://api.nuget.org/v3-flatcontainer/microsoft.dotnet.projectmodel/1.0.0-rc3-003121/microsoft.dotnet.projectmodel.1.0.0-rc3-003121.nupkg 227ms
2016-07-01T06:58:28.6946386Z log  : Installing Microsoft.DotNet.ProjectModel 1.0.0-rc3-003121.
2016-07-01T06:58:28.6956390Z log  : Installing Microsoft.AspNetCore.Server.IISIntegration.Tools 1.0.0-preview2-final.
2016-07-01T06:58:32.3480344Z error: Package Microsoft.DotNet.ProjectModel 1.0.0-rc3-003121 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.DotNet.ProjectModel 1.0.0-rc3-003121 supports:
2016-07-01T06:58:32.3500341Z error:   - net451 (.NETFramework,Version=v4.5.1)
2016-07-01T06:58:32.3500341Z error:   - netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.3510431Z error: One or more packages are incompatible with .NETCoreApp,Version=v1.0.
2016-07-01T06:58:32.7120347Z error: Package Microsoft.AspNetCore.Mvc 1.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.AspNetCore.Mvc 1.0.0 supports:
2016-07-01T06:58:32.7130338Z error:   - net451 (.NETFramework,Version=v4.5.1)
2016-07-01T06:58:32.7140347Z error:   - netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.7140347Z error: Package Microsoft.ApplicationInsights.AspNetCore 1.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.ApplicationInsights.AspNetCore 1.0.0 supports:
2016-07-01T06:58:32.7140347Z error:   - net451 (.NETFramework,Version=v4.5.1)
2016-07-01T06:58:32.7150344Z error:   - netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.7150344Z error: Package Microsoft.DotNet.ProjectModel.Loader 1.0.0-preview2-003121 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.DotNet.ProjectModel.Loader 1.0.0-preview2-003121 supports: netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.7160344Z error: Package Microsoft.DotNet.Cli.Utils 1.0.0-preview2-003121 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.DotNet.Cli.Utils 1.0.0-preview2-003121 supports:
2016-07-01T06:58:32.7160344Z error:   - net451 (.NETFramework,Version=v4.5.1)
2016-07-01T06:58:32.7160344Z error:   - netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.7174190Z error: One or more packages are incompatible with .NETCoreApp,Version=v1.0.
2016-07-01T06:58:32.7174190Z info : Committing restore...
2016-07-01T06:58:32.7210345Z log  : Writing lock file to disk. Path: C:\a\1\s\src\FjordTours.BasicApp\project.lock.json
2016-07-01T06:58:32.9154998Z log  : C:\a\1\s\src\FjordTours.BasicApp\project.json
2016-07-01T06:58:32.9174999Z log  : Restore failed in 44621ms.
2016-07-01T06:58:32.9274991Z NuGet Config files used:
2016-07-01T06:58:32.9294993Z Errors in C:\a\1\s\src\FjordTours.BasicApp\project.json
2016-07-01T06:58:32.9294993Z     Package Microsoft.DotNet.ProjectModel.Loader 1.0.0-preview2-003121 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.DotNet.ProjectModel.Loader 1.0.0-preview2-003121 supports: netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.9305008Z     Package Microsoft.DotNet.Cli.Utils 1.0.0-preview2-003121 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.DotNet.Cli.Utils 1.0.0-preview2-003121 supports:
2016-07-01T06:58:32.9305008Z       - net451 (.NETFramework,Version=v4.5.1)
2016-07-01T06:58:32.9315007Z       - netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.9315007Z     One or more packages are incompatible with .NETCoreApp,Version=v1.0.
2016-07-01T06:58:32.9325003Z     Package Microsoft.DotNet.ProjectModel 1.0.0-rc3-003121 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.DotNet.ProjectModel 1.0.0-rc3-003121 supports:
2016-07-01T06:58:32.9325003Z       - net451 (.NETFramework,Version=v4.5.1)
2016-07-01T06:58:32.9325003Z       - netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.9335002Z     One or more packages are incompatible with .NETCoreApp,Version=v1.0.
2016-07-01T06:58:32.9335002Z     Package Microsoft.AspNetCore.Mvc 1.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.AspNetCore.Mvc 1.0.0 supports:
2016-07-01T06:58:32.9345003Z       - net451 (.NETFramework,Version=v4.5.1)
2016-07-01T06:58:32.9345003Z       - netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.9355002Z     Package Microsoft.ApplicationInsights.AspNetCore 1.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.ApplicationInsights.AspNetCore 1.0.0 supports:
2016-07-01T06:58:32.9355002Z       - net451 (.NETFramework,Version=v4.5.1)
2016-07-01T06:58:32.9355002Z       - netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.9365007Z     Package Microsoft.DotNet.ProjectModel.Loader 1.0.0-preview2-003121 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.DotNet.ProjectModel.Loader 1.0.0-preview2-003121 supports: netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.9365007Z     Package Microsoft.DotNet.Cli.Utils 1.0.0-preview2-003121 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.DotNet.Cli.Utils 1.0.0-preview2-003121 supports:
2016-07-01T06:58:32.9374999Z       - net451 (.NETFramework,Version=v4.5.1)
2016-07-01T06:58:32.9374999Z       - netstandard1.6 (.NETStandard,Version=v1.6)
2016-07-01T06:58:32.9385006Z     One or more packages are incompatible with .NETCoreApp,Version=v1.0.
2016-07-01T06:58:32.9385006Z     C:\Users\buildguest\AppData\Roaming\NuGet\NuGet.Config
2016-07-01T06:58:32.9385006Z     C:\ProgramData\nuget\Config\Microsoft.VisualStudio.Offline.config
2016-07-01T06:58:32.9395005Z Feeds used:
2016-07-01T06:58:32.9395005Z     https://api.nuget.org/v3/index.json
2016-07-01T06:58:32.9405006Z     C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
2016-07-01T06:58:32.9514998Z Installed:
2016-07-01T06:58:32.9525024Z     159 package(s) to C:\a\1\s\src\FjordTours.BasicApp\project.json

global.json(由ASP.Net Core Web应用程序(.Net Core)模板创建):

The global.json (as created by the ASP.Net Core Web Application (.Net Core) template):

{
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-preview2-003121"
  }
}

project.json(由ASP.Net Core Web应用程序(.Net Core)模板创建):

The project.json (as created by the ASP.Net Core Web Application (.Net Core) template):

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0"
  },

  "tools": {
    "BundlerMinifier.Core": "2.0.238",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "Areas/**/Views",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

推荐答案

您应该这样替换project.json中的工具"部分:

You should replace "tools" section in your project.json like this:

    "tools": {
    "BundlerMinifier.Core": "2.1.258",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "imports": [
        "netstandard1.6"
      ]
    },
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.0.0-preview2-final",
      "imports": [
        "netstandard1.6"
      ]
    },
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview2-final",
      "imports": [
        "netstandard1.6"
      ]
    },
    "Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview2-final",
      "imports": [
        "portable-net45+win8+wp8+wpa81",
        "netstandard1.6"
      ]
    }
  },

某些软件包需要导入netstandard1.6 但是Microsoft.VisualStudio.Web.CodeGeneration.Tools需要netstandard1.6portable-net45+win8+wp8+wpa81

some packages needs to import netstandard1.6 but Microsoft.VisualStudio.Web.CodeGeneration.Tools needs netstandard1.6 and portable-net45+win8+wp8+wpa81

这篇关于无法使用托管代理在Visual Studio Team Services上构建默认的ASP.Net Core Web应用程序(.NET Core)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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