dotnet restore: One or more packages are incompatible with .NETCoreApp,Version=v1.0.
See original GitHub issueAfter adding “Microsoft.AspNetCore.Authentication.Facebook” dotnet refuses to restore. Even after removing the package, project.json will still not restore.
Steps to reproduce
My project.json looks like this:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-rc2-3002702",
"type": "platform"
},
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"System.Xml.XmlSerializer": "4.0.11-rc2-24027",
"Microsoft.EntityFrameworkCore": "1.0.0-rc2-final",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.AspNetCore.Authentication.Facebook": "1.0.0-rc2-final"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-rc2-20507",
"imports": [ "portable-net40+sl5+win8+wp8+wpa81" ]
},
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
Expected behavior
Restoring
Actual behavior
Throws the following error message:
Package Microsoft.Composition 1.0.27 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Composition 1.0.27 supports: portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259) One or more packages are incompatible with .NETCoreApp,Version=v1.0.
Edit I added the package from the Visual Studio “Quick Fix” menu
Issue Analytics
- State:
- Created 7 years ago
- Comments:21 (9 by maintainers)
Top Results From Across the Web
dotnet restore: One or more packages are incompatible ...
Steps to reproduce. My project.json looks like this: { "dependencies": { "Microsoft.NETCore. · Expected behavior. Restoring · Actual behavior.
Read more >Problem with "nuget restore" with some lib's in build azure ...
NETStandard,Version=v2.0) One or more packages are incompatible with .NETCoreApp,Version=v3.1.
Read more >dotnet restore command - .NET CLI
Learn how to restore dependencies and project-specific tools with the dotnet restore command.
Read more >NuGet Restore Fails on .NET Standard 2.0 Projects
Project PRJ supports: netstandard2.0 (.NETStandard,Version=v2.0) One or more projects are incompatible with .NETFramework,Version=v4.6.1.
Read more >NuGet Package Restore
See an overview of how NuGet restores packages a project depends on, including how to disable restore and constrain versions.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
After upgrading to VS2017 and therefore downgrading to XML I had to add it to my
.csproj
file like this:Just adding this here for others who come across this issue here. I managed to resolve the issue by adding
"net451"
to the imports section of mynetcoreapp1.1
framework dedendency of mypackage.json
file.My particular
package.json
file looked like this.