2016-07-01 10 views
12

Nachdem ein neues ASP.Net Core Webanwendung (.NET Core) Projekt in Visual Studio 2015 Update 3 erstellt und überprüft wurde dies in einem Visual Studio Team Services-Git-Repository. Ich verwende die Release-Version von .Net Core und ASP.Net Core.Kann ASP.Net Core Webanwendung (.NET Core) in Visual Studio Team Services mit Hosted Agent nicht erstellen

ich jetzt versuchen, die VSTS Build-System mit einer Builddefinition zu bauen diese mit auf diesem Handbuch basieren: https://www.visualstudio.com/en-us/docs/build/apps/aspnet/aspnetcore-to-azure

die Erstellung fehl am dotnet restore Schritt mit dem Protokoll jedoch weiter unten (erster Teil nicht enthalten, Dies ist von wo es anfängt zu versagen).

Was mache ich falsch? Muss ich die aktuellen Hosted Agents in irgendeiner Weise vorbereiten, damit dies mit der Version 1.0.0 von ASP.Net Core funktioniert?

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 

Die global.json (wie von der ASP.Net Core-Web-Anwendung (.NET Core) Vorlage erstellt):

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

Die project.json (wie von dem ASP.Net-Core erstellt Web-Anwendung (.NET Core) Vorlage):

{ 
    "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%" ] 
    } 
} 
+0

Ich habe diesen Anweisungen gefolgt, aber mit der Hosted Agent-Alternative. Wir möchten Hosted Agents verwenden, da wir derzeit keine Option zur Verwendung von Build Agents vor Ort haben. – TomRay74

+0

Auf der allgemeinen Registerkarte, welche "Nachfrage" haben Sie hinzugefügt? –

+0

Ich habe keine Nachfrage hinzugefügt. Was soll ich hinzufügen? Da ich die Hosted Agents nutze, kann ich scheinbar keine Forderungen hinzufügen. Gemäß dem oben erwähnten Dokument muss die Anforderung nur zu benutzerdefinierten Build-Agents hinzugefügt werden, aber bitte korrigieren Sie mich, wenn ich falsch liege. – TomRay74

Antwort

6

Sie sollten "Tools" in Ihrem project.json wie folgt ersetzen:

"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" 
     ] 
    } 
    }, 

einige Pakete benötigt netstandard1.6 aber Microsoft.VisualStudio.Web.CodeGeneration.Tools Bedürfnisse netstandard1.6 und portable-net45+win8+wp8+wpa81

+1

Großartig, das half mir, die meisten Fehler loszuwerden. Aber ich bekomme immer noch die gleichen Fehler für andere Pakete, von denen einige nicht explizit in der 'project.json' angegeben sind, wie zum Beispiel' Microsoft.DotNet.ProjectModel.Loader'. Wie kann ich herausfinden, wie Sie diese Probleme lösen können? – paulroho

+0

Ich hatte auch den Fehler mit Microsoft.DotNet.ProjectModel.Loader, aber in meinem Fall löste das Ersetzen des Werkzeugbereichs, wie in neodims Antwort beschrieben, es für mich. – TomRay74

+0

Als Seitenknoten sollten Sie keine Importe mehr mit Vorschau2 benötigen. Versuchen Sie, Ihre Cache (s) zu säubern.exe local -clear all ") – Pawel

1

ich mit dotnet restore das gleichen Problem des gehostete Build-Agenten in VSTS Verwendung angetroffen zu importieren. Basierend auf dem Kommentar von @svick habe ich ausgeführt, um zu überprüfen, was auf dem gehosteten Agent installiert ist. Ab heute ist es immer noch 1.0.0-preview1-002702 und nicht die referenzierte Version von 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 

Die offizielle Software für die Build-Agenten gehostet können https://www.visualstudio.com/en-us/docs/build/agents/hosted-pool finden. Beachten Sie insbesondere, dass es immer noch Visual Studio 2015 Update 2 anzeigt. Hoffentlich wird dies bald aktualisiert.

+0

Stand: 13. Juli 2016, Die von VSTS gehosteten Build-Agenten wurden aktualisiert, um" .NET Core 1.0 mit Preview 2 Tooling "einzuschließen. Siehe https://blogs.msdn.microsoft.com/visualstudioalm/2016/07/13/july-hosted-build-pool-image-updates/ –

Verwandte Themen