dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.45k stars 10.03k forks source link

Dotnet restore fails after upgrading to version 1.1 #1949

Closed glararan closed 7 years ago

glararan commented 7 years ago

Hi,

I'm trying to upgrade my project to 1.1. I installed SDK from official page. Using ASP.Net Core Web Application (.NET Framework)

Error:

PATH=.\node_modules.bin;D:\Programs\Visual Studio 14.0\Web\External;%PATH%;D:\Programs\Visual Studio 14.0\Web\External\git C:\Program Files\dotnet\dotnet.exe restore "F:\WebApplication1.vs\restore.dg" log : Restoring packages for F:\WebApplication1\project.json... log : Restoring packages for tool 'Microsoft.AspNetCore.Razor.Tools' in F:\WebApplication1\project.json... 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) 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: error: - net451 (.NETFramework,Version=v4.5.1) error: - netstandard1.6 (.NETStandard,Version=v1.6) error: One or more packages are incompatible with .NETCoreApp,Version=v1.0. log : Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in F:\WebApplication1\project.json... 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: error: - net451 (.NETFramework,Version=v4.5.1) error: - netstandard1.6 (.NETStandard,Version=v1.6) error: One or more packages are incompatible with .NETCoreApp,Version=v1.0. log : Restoring packages for tool 'Microsoft.EntityFrameworkCore.Tools.DotNet' in F:\WebApplication1\project.json... 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: error: - net451 (.NETFramework,Version=v4.5.1) error: - netstandard1.6 (.NETStandard,Version=v1.6) error: One or more packages are incompatible with .NETCoreApp,Version=v1.0. log : Restoring packages for tool 'Microsoft.Extensions.SecretManager.Tools' in F:\WebApplication1\project.json... log : Restoring packages for tool 'Microsoft.VisualStudio.Web.CodeGeneration.Tools' in F:\WebApplication1\project.json... error: Package Microsoft.VisualStudio.Web.CodeGeneration 1.1.0-preview4-final is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.VisualStudio.Web.CodeGeneration 1.1.0-preview4-final supports: error: - net451 (.NETFramework,Version=v4.5.1) error: - netstandard1.6 (.NETStandard,Version=v1.6) error: One or more packages are incompatible with .NETCoreApp,Version=v1.0. info : Committing restore... log : Lock file has not changed. Skipping lock file write. Path: F:\WebApplication1\project.lock.json log : F:\WebApplication1\WebApplication1.xproj log : Restore failed in 3010ms. Errors in F:\WebApplication1\WebApplication1.xproj 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) 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:

  • net451 (.NETFramework,Version=v4.5.1)
  • netstandard1.6 (.NETStandard,Version=v1.6) One or more packages are incompatible with .NETCoreApp,Version=v1.0. 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:
  • net451 (.NETFramework,Version=v4.5.1)
  • netstandard1.6 (.NETStandard,Version=v1.6) One or more packages are incompatible with .NETCoreApp,Version=v1.0. 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:
  • net451 (.NETFramework,Version=v4.5.1)
  • netstandard1.6 (.NETStandard,Version=v1.6) One or more packages are incompatible with .NETCoreApp,Version=v1.0. Package Microsoft.VisualStudio.Web.CodeGeneration 1.1.0-preview4-final is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.VisualStudio.Web.CodeGeneration 1.1.0-preview4-final supports:
  • net451 (.NETFramework,Version=v4.5.1)
  • netstandard1.6 (.NETStandard,Version=v1.6) One or more packages are incompatible with .NETCoreApp,Version=v1.0. NuGet Config files used: C:\Users\admin\AppData\Roaming\NuGet\NuGet.Config C:\ProgramData\nuget\Config\Microsoft.VisualStudio.Offline.config Feeds used: https://api.nuget.org/v3/index.json C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

project.json:

{ "userSecretsId": "aspnet-....", "dependencies": { "Microsoft.ApplicationInsights.AspNetCore": "2.0.0", "Microsoft.AspNet.Identity.Core": "2.2.1", "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0", "Microsoft.AspNetCore.Diagnostics": "1.1.0", "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0", "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0", "Microsoft.AspNetCore.Mvc": "1.1.1", "Microsoft.AspNetCore.Razor.Tools": { "version": "1.1.0-preview4-final", "type": "build" }, "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0", "Microsoft.AspNetCore.Server.Kestrel": "1.1.0", "Microsoft.AspNetCore.StaticFiles": "1.1.0", "Microsoft.DotNet.InternalAbstractions": "1.0.0", "Microsoft.EntityFrameworkCore": "1.1.0", "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0", "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0", "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final", "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0", "Microsoft.Extensions.Configuration.Json": "1.1.0", "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0", "Microsoft.Extensions.DependencyInjection": "1.1.0", "Microsoft.Extensions.Logging": "1.1.0", "Microsoft.Extensions.Logging.Console": "1.1.0", "Microsoft.Extensions.Logging.Debug": "1.1.0", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0", "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { "version": "1.1.0-preview4-final", "type": "build" }, "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { "version": "1.1.0-preview4-final", "type": "build" } }, "tools": { "Microsoft.AspNetCore.Razor.Tools": { "version": "1.1.0-preview4-final", "imports": "portable-net45+win8+dnxcore50" }, "Microsoft.AspNetCore.Server.IISIntegration.Tools": { "version": "1.1.0-preview4-final", "imports": "portable-net45+win8+dnxcore50" }, "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final", "Microsoft.Extensions.SecretManager.Tools": { "version": "1.1.0-preview4-final", "imports": "portable-net45+win8+dnxcore50" }, "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { "version": "1.1.0-preview4-final", "imports": [ "portable-net45+win8+dnxcore50", "portable-net45+win8" ] } }, "frameworks": { "net452": { "frameworkAssemblies": { "System.Runtime.Serialization": "4.0.0.0", "System.ServiceModel": "4.0.0.0", "System.Xml": "4.0.0.0" }, "dependencies": { "Shared": { "target": "project" } } } }, "buildOptions": { "emitEntryPoint": true, "preserveCompilationContext": true }, "publishOptions": { "include": [ "wwwroot", "Views", "appsettings.json", "web.config" ] }, "scripts": { "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] } }

What can be wrong?

Thanks

glararan commented 7 years ago

Okay, I'm idiot.. If anyone has same problem then you have to go to global.json and edit src to newest in C:/Program Files/dotnet/sdk :)

natemcmaster commented 7 years ago

It appears you figured it out. Closing.