Asp.net core 无法使用托管代理在Visual Studio Team Services上生成默认ASP.Net Core Web应用程序(.Net Core)

Asp.net core 无法使用托管代理在Visual Studio Team Services上生成默认ASP.Net Core Web应用程序(.Net Core),asp.net-core,azure-devops,project.json,dotnet-cli,Asp.net Core,Azure Devops,Project.json,Dotnet Cli,在Visual Studio 2015 Update 3中创建了一个新的ASP.Net Core Web应用程序(.Net Core)项目,并将其签入Visual Studio Team Services git存储库。我使用的是.NETCore和ASP.NETCore的发行版 我现在正尝试使用VSTS构建系统,使用基于本指南的构建定义来构建它: 但是,构建在dotnet restore步骤失败,日志如下所示(不包括第一部分,这是它开始失败的地方) 我做错了什么?我是否需要以任何方式准备当前托管

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

我现在正尝试使用VSTS构建系统,使用基于本指南的构建定义来构建它:

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

我做错了什么?我是否需要以任何方式准备当前托管的代理,以便在1.0.0版的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)模板创建):

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

您应该替换project.json中的“tools”部分,如下所示:

    "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.6
portable-net45+win8+wp8+wpa81
我在VSTS中使用托管构建代理时遇到了同样的问题。根据@svick的评论,我运行了
dotnet--version
,检查托管代理上安装了什么。到今天为止,它仍然是
1.0.0-preview1-002702
,而不是
1.0.0-preview2-003121
的参考版本

2016-07-04T06:17:47.5047693Z ##[warning]File name doesn't indicate a full path to a executable file.
2016-07-04T06:17:47.5057787Z Executing the following command-line. (workingFolder = C:\a\1\s)
2016-07-04T06:17:47.5057787Z dotnet --version
2016-07-04T06:17:47.5067748Z Error message highlight pattern: 
2016-07-04T06:17:47.5067748Z Warning message highlight pattern: 
2016-07-04T06:17:48.9679166Z 1.0.0-preview1-002702

托管构建代理的官方软件可在上找到。特别是,请注意它仍然显示
Visual Studio 2015 Update 2
。希望它能很快得到更新。

我确实遵循了这些说明,但使用了托管代理替代方案。我们希望使用托管代理,因为我们目前没有选择使用内部构建代理。在“常规”选项卡上,您添加了什么“需求”?我没有添加任何需求。我应该补充什么?因为我使用的是托管代理,所以我似乎无法添加任何需求。此外,根据上面提到的文档,只需将需求添加到自定义生成代理,但如果我错了,请更正我。这看起来生成系统使用的是较旧版本的.Net Core SDK。能否将其升级到1.0?截至2016年7月13日,VSTS托管的构建代理已更新为包含“.NET Core 1.0和预览2工具”。很好,这帮我摆脱了大部分错误。但是对于其他包,我仍然会遇到相同的错误,其中一些错误没有在
project.json
中明确说明,例如
Microsoft.DotNet.ProjectModel.Loader
。我如何找到解决这些问题的方法?我在Microsoft.DotNet.ProjectModel.Loader中也遇到了错误,但在我的案例中,按照neodim的回答中所述替换工具部分为我解决了问题。作为一个侧节点,您应该不再需要使用preview2导入。请尝试清理缓存(
nuget.exe locals-清除所有内容)
)自2016年7月13日起,VSTS托管的生成代理已更新为包含带预览2工具的“.NET Core 1.0”。看见
    "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"
      ]
    }
  },
2016-07-04T06:17:47.5047693Z ##[warning]File name doesn't indicate a full path to a executable file.
2016-07-04T06:17:47.5057787Z Executing the following command-line. (workingFolder = C:\a\1\s)
2016-07-04T06:17:47.5057787Z dotnet --version
2016-07-04T06:17:47.5067748Z Error message highlight pattern: 
2016-07-04T06:17:47.5067748Z Warning message highlight pattern: 
2016-07-04T06:17:48.9679166Z 1.0.0-preview1-002702