Search code examples
.net-coredotnet-cli

dotnet run - looking for Microsoft.NETCore.App 1.1.0 (not preview) - I never refer to it


I have a fairly in-depth project setup with 10-20 libraries, and I'm trying to build an executable which uses them.

I have .NET Core 1.1.0 preview1 installed. With new projects, everything works fine. dotnet restore and dotnet build also work fine for this project, but somewhere along the line, something is wrong, and it will not run.

dotnet run yields:

The specified framework 'Microsoft.NETCore.App', version '1.1.0' was not found.
  - Check application dependencies and target a framework version installed at:
      C:\Program Files\dotnet\shared\Microsoft.NETCore.App
  - The following versions are installed:
      1.0.1
      1.1.0-preview1-001100-00
  - Alternatively, install the framework version '1.1.0'.

My library projects have:

  "frameworks": {
    "netstandard1.6": {
      "dependencies": {
        "NETStandard.Library": "1.6.1-preview1-*"
      }
    }
  }

My executable project has:

  "frameworks": {
    "netcoreapp1.1": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.1.0-preview1-*",
          "type": "platform"
        }
      },
      "imports": [ "dnxcore50", "portable-net45+win8" ]
    }
  }

It does also reference another project which is set up with an entry point, whose frameworks section is identical, minus the imports section.

I've also updated any EF Core and ASP.NET Core references to their preview1-* versions, though I am using plenty of other dependencies too (which weren't versioned in the same way).

So, as you can see, I have 1.1.0-preview1-001100-00 installed, am not referencing 1.1.0 anywhere, and yet receiving this message looking for it.

What could be causing this, and/or how can I track it down? I've tried scouring project.json.lock files, but can't see any references to 1.1.0 there, with the exception of an entry for Microsoft.NETCore.App/1.1.0 under libraries and again under the ".NETCoreApp,Version=v1.1" part of targets.


Solution

  • Wildcards aren't appropriate and don't work for this kind of platform dependency.

    It's necessary to use

    "version": "1.1.0-preview1-001100-00"

    and not

    "version": "1.1.0-preview1-*"