2
votes

I've tried to get NancyFx running with .Net Core under Ubuntu and Windows but I get the message that NancyFx it not compatible with .NetCoreApp. I'm new to the whole .Net Core thing, so any help is welcome.

My project.json

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },

    "dependencies": {
        "Microsoft.NETCore.App": "1.0.1",
        "Nancy": "2.0.0-barneyrubble"
    },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": "dnxcore50"
    }
  }
}

Error Message on dotnet restore

Errors in D:\User\Documents\Visual Studio 2015\Projects\WebService\src\WebService\project.json
    Package Nancy 2.0.0-barneyrubble is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Nancy 2.0.
0-barneyrubble supports:
      - net452 (.NETFramework,Version=v4.5.2)
      - netstandard1.6 (.NETStandard,Version=v1.6)
    One or more packages are incompatible with .NETCoreApp,Version=v1.0.
dotnet --version
1.0.0-preview2-003131

There are a few tutorial around which show people using Nancy on .Net Core, so am I doing something wrong?

1
Any chance you could run dotnet --version to determine which CLI version you're using?Kévin Chalet
You're using net standard 1.0. You should be using 1.6Phill
Update to the latest .net CLI (1.0.0-preview2-003131) and it will work.Sifiso Shezi
@Pinpoint I've added the dotnet version. It's the currenlty (27.09.2016) most up to date.secana
@secana can you check that your project doesn't have a global.json file that doesn't specify a different SDK version?Kévin Chalet

1 Answers

2
votes

I've found the answer. The problem was the missing type in the Microsoft.NETCore.App dependency.

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },

    "dependencies": {
        "Microsoft.NETCore.App": {
            "version": "1.0.1",
            "type": "platform"
        },
        "Nancy": "2.0.0-barneyrubble"
    },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": "dnxcore50"
    }
  }
}

Builds perfectly on Windows and Linux.