sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Compilation failure after fresh install (F#)

Open Biarity opened this issue 10 years ago • 25 comments

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)

Biarity avatar Nov 20 '16 07:11 Biarity

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.

ondrejgr avatar Nov 20 '16 10:11 ondrejgr

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.

lambdakris avatar Nov 20 '16 16:11 lambdakris

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

TheRealPiotrP avatar Nov 20 '16 17:11 TheRealPiotrP

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" } } } }

ondrejgr avatar Nov 20 '16 20:11 ondrejgr

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

Biarity avatar Nov 20 '16 21:11 Biarity

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 avatar Nov 20 '16 21:11 enricosada

@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 avatar Nov 21 '16 20:11 battisti

@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 avatar Nov 22 '16 00:11 enricosada

ztnbot avatar Nov 22 '16 00:11 ztnbot

@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 avatar Nov 22 '16 07:11 ondrejgr

@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 avatar Nov 22 '16 11:11 enricosada

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

TheRealPiotrP avatar Nov 23 '16 07:11 TheRealPiotrP

@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

enricosada avatar Nov 23 '16 17:11 enricosada

@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)

enricosada avatar Nov 23 '16 23:11 enricosada

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.

ghost avatar Nov 26 '16 10:11 ghost

@rogersachan the Eclipse Che support f#?

enricosada avatar Nov 26 '16 22:11 enricosada

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

ghost avatar Nov 27 '16 03:11 ghost

@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 avatar Nov 27 '16 14:11 enricosada

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

ghost avatar Nov 27 '16 16:11 ghost

@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 avatar Nov 27 '16 16:11 enricosada