Skip to content

.NET Core console template for fsharp fails to build on Linux at SDK version 1.0.4 #8585

@ryukinix

Description

@ryukinix

Steps to reproduce

Install SDK 1.0.4 and compatible .NET Core runtime 1.1.2 on Linux

dotnet new console -n test
cd test
dotnet restore
dotnet build

Expected behavior

Just build and works.

Actual behavior

Dotnet commands dotnet build and dotnet msbuild fails on building. But using msbuild tool installed externally with version 15.2.0.0 works, so I'm guessing If that can be something related about the new .fsproj format with this template, or something like that.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.4)

Product Information:
 Version:            1.0.4
 Commit SHA-1 hash:  af1e6684fd

Runtime Environment:
 OS Name:     manjaro
 OS Version:  
 OS Platform: Linux
 RID:         ubuntu.16.10-x64
 Base Path:   /opt/dotnet/sdk/1.0.4

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview2-25407-01
  Build    : 40c565230930ead58a50719c0ec799df77bddee9

I know that Arch or Arch-based (Manjaro is a Arch-based) distros are not supported, but seems that problem is something about setup and .fspro, so maybe can be fixed easily If I'm something. I'll really appreciate If someone can help me, but I'll understand if is not.

Personal debugging

On the output of dotnet build -v normal that I attached here, I saw that:

It was not possible to find any compatible framework version
         The specified framework 'Microsoft.NETCore.App', version '1.0.1' was not found.
           - Check application dependencies and target a framework version installed at:
               /
           - Alternatively, install the framework version '1.0.1'.

Why the build is trying target 1.0.1 version if I used the sdk 1.0.4? Is there a way to force to target to 1.0.4 on template creation?

My .fsproj is that:

<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Program.fs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="FSharp.Core" Version="4.1.*" />
    <PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" />
  </ItemGroup>

</Project>

An additional information: I installed earlier the sdk-2.0-preview-06497 with its runtime and the console app works fine for F#, but unfortunately I have serious problems using fable with it (so I downgrade to 1.0.4 and removed all the references of sdk-2.0 on my system). For Fable with 2.0 SDK always on build, no matter what I edit the template, I got Not found 'Microsoft.NETCore.App', version '1.0.4'. And yes, I followed the instructions for install the template for .NET Core v2 on the Fable guidelines. Downgrading SDK for 1.0.4 worked fine for Fable, but now I have a problem with the console app template. T_T

What I installed:

The easy way to replicate that installation is doing on a Arch-based Linux (like Manjaro) with yaourt AUR (Arch User Repository) helper: yaourt -S dotnet-host dotnet-runtime-1.1 dotnet-sdk-1.1

And all the referenced packages will be installed on the system.

Thanks in advance and the patience for read that T_T. Sorry for any mess.

I'm thinking if someone of that packages have some conflict version with each other...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions