0

I have created a .NetCore Class Library which I have tested in same solution with .NetCore Console Application (and it works just fine), however when I try referencing it inside another (ASP.NET Core Web Application) solution as a NuGet package I always get a error

NU1002 The dependency YoutubeExtractorCore 0.0.6 does not support framework .NETCoreApp,Version=v1.0.

I have added the netcoreapp1.0 in the class library project.json, which looks like this:

{
  "title": "YoutubeExtractorCore",
  "description": ".NET Core library used for extracting information about Youtube videos",
  "version": "0.0.6-*",

  "dependencies": {
    "NETStandard.Library": "1.6.0",
    "Newtonsoft.Json": "9.0.1"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": "dnxcore50",
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.0.0"
        }
      }
    },
    "netstandard1.6": {
      "imports": "dnxcore50"
    }
  }
}

I spent this afternoon trying to fix the problem but I cannot even understand why this error occurs.

2
  • are you sure asp.net core app is using .net core app 1.0 or lesser version? Commented Sep 10, 2016 at 17:28
  • @Venky I think it is 1.0, but i am not sure anymore. Anyway, here is ASP.NET Core project.json, targeting the netcoreapp1.0 framework. link I added the netstandard1.6 framework too, since I wasn't sure if it is needed or not. Commented Sep 10, 2016 at 17:57

1 Answer 1

1

I finally figured out what was causing the problem. The NuGet package I created was packed with nuget.exe manually, and for some reason did not have the frameworks and their dependencies listed. I fixed the package by executing dotnet pack on the class library and this produced correcly packed NuGet package.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.