Sdk: Compilation failure after fresh install (F#)

Created on 20 Nov 2016  路  25Comments  路  Source: dotnet/sdk

Steps to reproduce

In a new directory, follow these commads:
dotnet new -l F#
dotnet restore

Expected behavior

Running dotnet run or dotnet build works like in a C# .NET Core project.

Actual behavior

When doing dotnet run or dotnet build, you'll get a compilation error, even though the installation is clean, all configs are default.

Environment data

dotnet --info output:
.NET Command Line Tools (1.0.0-preview2-1-003177)

Product Information:
Version: 1.0.0-preview2-1-003177
Commit SHA-1 hash: a2df9c2576

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

_(I also have 1.1.0 current installed)_

Full error produced

Compiling Library for .NETStandard,Version=v1.6

The specified framework 'Microsoft.NETCore.App', version '1.0.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.1.0

  - Alternatively, install the framework version '1.0.0'.

I also tried...

  • uninstalling & reinstalling all of .NET Core
  • doing this on a clean windows VM (same error)
Area-External

Most helpful comment

@battisti thx for testing! i tried locally and require a new release of dotnet-compile-fsc (dunno why in my previous local tests was working ok before, probably i mixed cli version) with correct deps. i'll publish that tomorrow.

And yes @piotrpMSFT the tests for templates are my next todo (preview2.1, preview4).
At least i just enabled full ci for all os! in https://github.com/dotnet/netcorecli-fsc/pull/45 (dotnet-ci is really fast).
But i really want remote templates 馃槶馃槶馃槶

All 25 comments

I have the same problem. C# project compiles just fine. F# does not.
I tried OSX and Windows.
This problem occurs when using .NET Core 1.1, when I downloaded .NET Core 1.0, the project compiles without problem.

I also ran into this problem. I imagine the template for F# needs to be updated to work with .NET Core SDK 1.1.0. I opened a supporting issue on the dotnet/netcorecli-fsc repo, https://github.com/dotnet/netcorecli-fsc/issues/42.

Have you tried rev'ing the project.json version number for Microsoft.NetCore.App to 1.1?

@enricosada we just chatted about tests for f# templates...

piotrpMSFT: it's already targeting 1.1. Here's the json:
{ "version": "1.0.0-*", "buildOptions": { "debugType": "portable", "emitEntryPoint": true, "compilerName": "fsc", "compile": { "includeFiles": [ "Program.fs" ] } }, "tools": { "dotnet-compile-fsc": "1.0.0-preview2.1-*" }, "frameworks": { "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "type": "platform", "version": "1.1.0" }, "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160629" } } } }

@piotrpMSFT I tried editing the versioning in project.json to counter the error message with no success too. Still the same error.

dotnet-compile-fsc": "1.0.0-preview2.1-*"

Is 1.0.0-preview2-*

I'll send a pr with correct template and update wiki, and comment in this issue.

But check Also there meanwhile http://blog.2mas.xyz/fsharp-suave-app-on-dotnet-core-on-kubernetes-on-google-cloud/

@enricosada Replacing the value for the dotnet-compile-fsc field from "1.0.0-preview2.1-" to "1.0.0-preview2-" still results in the same error (using macOS 10.12).

Replacing the value for the Microsoft.FSharp.Core.netcore field with the current (as of today) version "1.0.0-alpha-161111" also does not fix the error.

@battisti thx for testing! i tried locally and require a new release of dotnet-compile-fsc (dunno why in my previous local tests was working ok before, probably i mixed cli version) with correct deps. i'll publish that tomorrow.

And yes @piotrpMSFT the tests for templates are my next todo (preview2.1, preview4).
At least i just enabled full ci for all os! in https://github.com/dotnet/netcorecli-fsc/pull/45 (dotnet-ci is really fast).
But i really want remote templates 馃槶馃槶馃槶

+

@enricosada : I'm not sure how this relates to the templates you mention. I think templates are correct.
FYI, I cloned https://github.com/dotnet/netcorecli-fsc and there are tests in the build script of F# project templates (TestApp, TestAppWithArgs,TestLibrary, ...).
They all fail with the discussed error :-)
BTW, running alone the tool with command:

dotnet compile-fsc

results in the same error (The specified framework 'Microsoft.NETCore.App', version '1.0.0' was not found.)

@ondrejgr yes the issue is with dotnet-compile-fsc, not with dotnet-new template.
the preview2.1 require a different version of dotnet-compile-fsc than preview2. i'll publish that soon

@enricosada please get the PR out tomorrow if you need a change in the next release...

@piotrpMSFT about templates, i sent dotnet/cli#4827 (preview2) dotnet/cli#4828 (preview2.1), updated dotnet/cli#4789 (preview4).
i hope to release really soon, the dotnet-compile-fsc 1.0.0-preview2.1, i hope tonight (tomorrow morning), i was a bit busy yesterday and dont want to publish without more testing

@piotrpMSFT ok template prs should be ok, i hope i am in time.
the dotnet-compile-fsc is not yet published (testing locally and i want to add ci in dotnet/netcorecli-fsc to check preview2/preview2.1)

The updated template linked to (http://blog.2mas.xyz/fsharp-suave-app-on-dotnet-core-on-kubernetes-on-google-cloud/) is also broken.

P.S. Is there any update to this? I can't upgrade the version of any other .NET Core templates for Eclipse Che if this isn't going to be fixed soon.

@rogersachan the Eclipse Che support f#?

@enricosada Yes, they support .NET Core - indirectly F# since I contributed the template to them. They have basic support for the lang such as highlighting and basic code completion.

P.S. We haven't upgraded our .NET Core version yet, but it doesn't help having the rug pulled out from under my feet since this will now become a blocking issue when we do move.

@rogersachan nice to see more ides support!

I can't upgrade the version of any other .NET Core templates for Eclipse Che if this isn't going to be fixed soon.

@rogersachan Your issue is blocking because the default templates use the net core 1.1 ? because the LTS is .net core 1.0 atm.

@enricosada "Current releases include the latest features and are supported for three months after the next release, so you should always stay in the latest version."

This is directly from the site and is what led us to upgrade.

@rogersachan i dont know your project and reasons, but atm new .net core 1.1 changes are not much (respect of .net core 1.0) ref https://github.com/dotnet/core/blob/master/release-notes/1.1/1.1.md pratically more distro and some perf atm, plus some bugs (but big one are backported to preview2 and .net core 1.0.* too).
"Stay to latest version" i think mean latest of Current preview2.1. Using preview2 LTS is safe, that's what i use in my projects too for example. Maybe someone from .net team my comment about that.
That's why i'll try to fix 1.1 asap, but priority for me is preview2 and preview4 atm

@enricosada It's the tooltips from https://www.microsoft.com/net/download/core when you hover over LTS and Latest

@rogersachan i think that's ambiguous. i think it mean:

  • use LTS and use lts updates, will be updated and supported X years
  • use Current but each release of current will be out-of-support after three months of next Current. so you need to periodically update Current.
    maybe we should just open a new issue asking for clarifying

@enricosada are we still tracking anything here?

Let's reopen this one if there is still some CLI issue here.

Please close, is tracked in netcorecli-fsc

There is a package to fix it in feed https://www.myget.org/F/netcorecli-fsc-preview2-1/api/v3/index.json waiting for publish on nuget.org

Was this page helpful?
0 / 5 - 0 ratings