dotnet run looking for Microsoft.NETCore.App 1.1.0 (not preview), without me referencing it #4599

Closed
kierenj opened this Issue Nov 3, 2016 · 19 comments

Projects

None yet

5 participants

@kierenj
kierenj commented Nov 3, 2016 edited

Steps to reproduce

Unfortunately I only have a fairly complex, private set of projects which exhibit this.

I am very happy to spend time diagnosing, sharing specific information and trying things out.

Basically, though: dotnet run on my project, whose setup is described in a little more detail here: http://stackoverflow.com/questions/40396769/dotnet-run-looking-for-microsoft-netcore-app-1-1-0-not-preview-i-never-ref . Key facts:

  • I have preview1-001100-00 installed (it works with new and other projects)
  • I only reference Microsoft.NETCore.App 1.1.0-preview1-*

Expected behavior

Project runs as it did before.

Actual behavior

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'.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-1-003155)

Product Information:
 Version:            1.0.0-preview2-1-003155
 Commit SHA-1 hash:  d7b0190bd4

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64

Anything I can do to dig in deeper, diagnose, things to look for, I'm all ears!

@GuardRex
GuardRex commented Nov 3, 2016 edited

I hit this, too. The preview must be installed locally:

Windows x64: https://go.microsoft.com/fwlink/?LinkID=831453
Windows x86: https://go.microsoft.com/fwlink/?LinkID=831458
macOS x64: https://go.microsoft.com/fwlink/?LinkID=831445
Linux x64: https://github.com/dotnet/core/blob/master/release-notes/preview-download.md

[EDIT] It wasn't enough to merely reference the metapackage for my self-contained app ...

"Microsoft.NETCore.App": "1.1.0-preview1-001100-00",

... I had to run the installer to get the bits into C:\Program Files\dotnet\shared\Microsoft.NETCore.App

@kierenj
kierenj commented Nov 3, 2016

@GuardRex, I think I have that already - as I say, I've installed the preview1, other 1.1.0-preview1 apps work fine, and the output of dotnet run states I have 1.1.0-preview1-001100 installed. Are you /sure/ its the same issue?

@GuardRex
GuardRex commented Nov 3, 2016

Oh, sorry. 😄 I was just remarking on Slack that I haven't had enough ☕️ yet this morning (or 🍺 Hooray Cubs!)

Anywho, yeah, I sort of wanted to just ref the metapackage and 🎵 jam on it 🎵, but I hit the same thing you did.

@gkhanna79
Member

I believe the activation path only supports specifying exact version of M.N.App.

@GuardRex
GuardRex commented Nov 3, 2016

... but "Microsoft.NETCore.App": "1.1.0-preview1-001100-00", is the exact version, no? (confused 😕 )

@gkhanna79
Member

Yes, that is the exact version. Maybe I misunderstood since -* was being referred to above:

I only reference Microsoft.NETCore.App 1.1.0-preview1-*

Is that not correct?

@GuardRex
GuardRex commented Nov 3, 2016

In my case what I did was use the exact version in a self-contained project, so I didn't have "type": "platform" on the dep. I saw that this package was listed at NuGet. I naively thought that I could just list the metapackage, restore, and publish, but it choked and demanded that the metapackage appear at C:\Program Files\dotnet\shared\. After I ran the installer and the package was there, it worked.

I guess the thing that I'm confused about is that this requirement didn't seem to be the case for other packages or metapackages referenced this way in project.json IIRC. Why does this particular metapackage need to be installed locally in that folder?

@gkhanna79
Member

M.N.App defines the core .NET Core FX and when referencing it, it is expected to be present in dotnet\shared for portable apps or will be published alongwith the app when it is published as standalone.

it choked and demanded that the metapackage appear at C:\Program Files\dotnet\shared.

Did you publish the application as standalone? If so, can you please share the repro project for @schellap to take a look at?

@GuardRex
GuardRex commented Nov 3, 2016

Yes, the app is self-contained and published as such. I'll repro myself one more time in a few hours and then put up a repro project and signal you back here.

@kierenj
kierenj commented Nov 3, 2016

(In case you are referring to my original issue - I'll try without the preview1-* shortly and report back)

@GuardRex
GuardRex commented Nov 3, 2016 edited

@gkhanna79 @schellap

It's up now at https://github.com/GuardRex/CLI_Issue_4599

If the metapackage folder is present at C:\Program Files\dotnet\shared\Microsoft.NETCore.App ...

capture

... it's all good. If I just drag that version folder out, I get the ...

The specified framework 'Microsoft.NETCore.App', version '1.1.0-preview1-001100-00' 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.0
      1.0.1
  - Alternatively, install the framework version '1.1.0-preview1-001100-00'.

... message.

[EDIT] The problem for me was a publish (not a run) with ...

dotnet publish --configuration Release --runtime win10-x64

... I wasn't trying to run the project locally.

I think this is just going to turn out to be a misunderstanding on my part about the local requirement for Microsoft.NETCore.App vis-a-vis the tooling.

What I originally attempted to do was use 1.0 (or 1.0.x) tooling while upgrading the project to 1.1.0 thinking that I could just drop in a dep for "Microsoft.NETCore.App": "1.1.0-preview1-001100-00" and go.

@livarcocc
Member

Yeah, you need to have the runtime installed in the box in order to be able to run your project.

@GuardRex
GuardRex commented Nov 3, 2016 edited

@livarcocc ok, cool 👍 ... I just didn't "get it" on that one, but I wasn't trying to run it locally tho. I was just trying to publish it with the metapackage not having "type": "platform" on it (self-contained app), so that's why I was confused. I certainly don't mind having to have the metapackage installed locally in order for it to compile/publish correctly.

Thx for clearing it up for me. I think a few others tho will hit that and scratch their head, so perhaps its just as well it came up here.

@livarcocc
Member

@kierenj Have you had a chance to try this out without the preview1-*?

@schellap
Contributor
schellap commented Nov 3, 2016

Dup of #2454

@GuardRex we spent a long thread on this one!

@GuardRex
GuardRex commented Nov 3, 2016

I didn't realize that was the case (and truly I forgot about the other one! lol 😄 )

@livarcocc
Member

ok. Closing this one.

@livarcocc livarcocc closed this Nov 3, 2016
@kierenj
kierenj commented Nov 4, 2016

I've tried it without the wildcard, and it works fine. Not sure it's a clean dupe of the other issue (which was to do with publish, had a different error message, etc)? - and this was kind of hijacked, but whatever, it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment