dotnet new
dotnet restore
install-package Microsoft.EntityFrameworkCore.Tools -Pre
dotnet restore
PM> dotnet restore
log : Restoring packages for C:\Users\[...]\project.json...
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethost/index.json
info : Committing restore...
log : Writing lock file to disk. Path: C:\Users\[...]\project.lock.json
log : C:\Users\[...]\project.json
log : Restore completed in 1415ms.
NuGet Config files used:
C:\Users\[...]\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\
log : Restoring packages for C:\Users\sp-install\Documents\Visual Studio 2015\Projects\dbproj\project.json...
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethostresolver/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.netcore.dotnethost/index.json
warn : Detected package downgrade: Microsoft.NETCore.App from 1.0.0 to 1.0.0-rc2-3002702
warn : dbproj (>= 1.0.0) -> Microsoft.EntityFrameworkCore.Tools (>= 1.0.0-preview2-final) -> Microsoft.NETCore.App (>= 1.0.0)
warn : dbproj (>= 1.0.0) -> Microsoft.NETCore.App (>= 1.0.0-rc2-3002702)
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: 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.
info : Committing restore...
log : Lock file has not changed. Skipping lock file write. Path: C:\Users\[...]\project.lock.json
log : C:\Users\[...]\project.json
log : Restore failed in 1629ms.
dotnet :
At line:1 char:1
+ dotnet restore
+ ~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Errors in C:\Users\[...]j\project.json
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)
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.
dotnet --info output:
PM> dotnet --info
.NET Command Line Tools (1.0.0-preview1-002702)
Product Information:
Version: 1.0.0-preview1-002702
Commit Sha: 6cde21225e
Runtime Environment:
OS Name: Windows
OS Version: 6.3.9600
OS Platform: Windows
RID: win81-x64
Same thing but on OS X.
Here is my project.json for reference. Let me know what I should fix...
{
"userSecretsId": "some-id",
"version": "1.0.0",
"authors": [
"Dmytro Bogatov"
],
"dependencies": {
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-*",
"Npgsql": "3.1.0",
"Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.0-*",
"Npgsql.EntityFrameworkCore.PostgreSQL.Design": "1.0.0-*",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-*",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.0-*",
"Microsoft.EntityFrameworkCore.Sqlite": "1.0.0-*",
"Microsoft.EntityFrameworkCore.Sqlite.Design": "1.0.0-*",
"Microsoft.EntityFrameworkCore.InMemory": "1.0.0-*",
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0-*",
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-*",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-*",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-*",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-*",
"Microsoft.Extensions.Configuration.Json": "1.0.0-*",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-*",
"Microsoft.Extensions.Logging": "1.0.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*",
"Microsoft.Extensions.Logging.Debug": "1.0.0-*",
"NetTelegramBotApi": "3.7.50926",
"Microsoft.NETCore.Platforms": "1.0.1-*",
"Microsoft.AspNetCore.Session": "1.0.0-*",
"Npm.js": "2.13.1",
"MailKit": "1.3.0-*",
"Microsoft.AspNetCore.Cors": "1.0.0-*"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dnxcore50",
"portable-net45+win8"
]
}
},
"runtimes": {
"osx.10.11-x64": {},
"ubuntu.14.04-x64": {},
"win7-x64": {}
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
},
"Microsoft.Extensions.SecretManager.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},
"runtimeOptions": {
"gcServer": false,
"gcConcurrent": true
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"compile": {
"exclude": [
"wwwroot",
"node_modules"
]
}
},
"publishOptions": {
"include": [
"appsettings.json",
"wwwroot",
"Views"
],
"exclude": [
"**.user",
"**.vspscc"
]
},
"scripts": {
"prepublish": [
"npm install",
"bower install --allow-root",
"gulp clean",
"gulp min",
"gulp ts-debug"
]
}
}
There's a discussion about this issue going on over at http://stackoverflow.com/questions/38081734/unable-to-restore-a-asp-net-core-1-0-rtm-solution
Run the following in package manager console:
dotnet new
dotnet restore
install-package Microsoft.EntityFrameworkCore.Tools -Pre
install-package Microsoft.EntityFrameworkCore.Tools.Core -Pre
install-package Microsoft.EntityFrameworkCore.Tools.Cli -Pre
dotnet restore
Then in the tools section of project.json, you will need to ensure that you import net451:
"tools": {
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"imports": "net451"
}
}
I had that issue
Project MyProject.Data.SqlServer is not compatible with netstandard1.6 (.NETStandard,Version=v1.6). MyProject.Data.SqlServer supports: netcoreapp1.0 (.NETCoreApp,Version=v1.0)
One or more projects are incompatible with .NETStandard,Version=v1.6.
In my case the MyProject.Data.SqlServer class library project has the workaround necessary to be able to apply migrations there as per: http://benjii.me/2016/06/entity-framework-core-migrations-for-class-library-projects/ although that is irrelevant here.
The problem was that I was treating a console application as a class library application and the project.json was not correct because I was using the framework netstandard1.6 instead the netcoreapp1.0.
UWP is also affected its not just the asp.net tools, UWP will not find compatible packages for the life of it.
The workaround proposed by @rbeadie worked for me with only the imports added to the tools section. I didn't actually need the installs (other than Tools itself).
same here.., workaround didn't work for me though
This also was caused for me (in another project) when I didn't update my global.json to the new version of the SDK. In my case, I just deleted global.json and it defaulted to latest (which is what I have installed).
I had this issue too. But only on one of my PC.
The same code can run correctly on another PC & VSTS.
I could workaround it with this solution: http://stackoverflow.com/a/38207414/890890
This was shown to be an issue with an older CLI + Nuget combination. I'm not able to repro this today.
Most helpful comment
Workaround/Correct Install
Run the following in package manager console:
Then in the
toolssection ofproject.json, you will need to ensure that you importnet451: