Package [some package] is not compatible with netcoreapp1.0

后端 未结 4 476
伪装坚强ぢ
伪装坚强ぢ 2020-12-10 01:45

On dotnet restore we are receiving the following error:

Package Microsoft.AspNet.SomePackage 5.6.7 is not compatible with netcoreapp1.0

相关标签:
4条回答
  • 2020-12-10 02:15

    If you need to do the same thing but are using the new .csproj for configuration rather than the project.json, edit your .csproj file and add the following right below the propertygroup:

    <PropertyGroup>
        <PackageTargetFallback>net451;dotnet5.6;portable-net45+win8</PackageTargetFallback>
    </PropertyGroup>
    

    Taken from here.

    0 讨论(0)
  • 2020-12-10 02:24

    requirejs is on github (https://github.com/requirejs/requirejs) and it is possible to compile it with core as dependency.

    If the package is open source or the source is available then it is possible to recompile with dot net core instead for 4.5 framework. It all depends on other other dependencies and their compatibility with dotnet core.

    0 讨论(0)
  • 2020-12-10 02:30

    The short answer is, you can't. In some narrow cases you can use imports to override nuget's built in dependency rules. In this case you cannot, .NET Framework and .NET Core are incompatible. The errors says the package only supports net45 (.NET Framework 4.5). You cannot use it with your .NET Core application

    0 讨论(0)
  • 2020-12-10 02:36

    Note - by adding "net451" to the framework imports I was able to make it work.

    "frameworks": {
       "netcoreapp1.0": {
          "imports": [
             "net451",
             "dotnet5.6",
             "portable-net45+win8"
           ]
       }
    },
    

    I took it from here

    0 讨论(0)
提交回复
热议问题