sdk: dotnet restore: One or more packages are incompatible with .NETCoreApp,Version=v1.0.
After 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
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 21 (9 by maintainers)
After upgrading to VS2017 and therefore downgrading to XML I had to add it to my
.csprojfile 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.1framework dedendency of mypackage.jsonfile.My particular
package.jsonfile looked like this.The problem is most likely the tool “Microsoft.VisualStudio.Web.CodeGeneration.Tools”. Add the imports to the section:
“Microsoft.VisualStudio.Web.CodeGeneration.Tools”: { “version”: “1.0.0-preview1-final”, “type”: “build”, “imports”: [ “portable-net45+win8+dnxcore50”, “portable-net45+win8” ] }
That dose not help.
@piotrpMSFT Having same issue when upgraded to .NET Core 1.1 and workaround above did not solve the issue.
fyi there is a breaking change coming in 2.0 - this is changing to be
AssetTargetFallback(which .NET Core 2.0 apps have by default) and cannot be used together withPackageTargetFallback@gitfortee The
$()syntax is used to substitute with the value of a property. In this case, thePackageTargetFallbackis extended by a part. (So if it wasabefore it will bea;portable-…)I am encountering the same issue with core 1.1. The fix identified by @radenkozec didn’t work.