New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet new classlib doesn't allow to specify a different framework (-f) when using F# (-lang F#) on Ubuntu #103

Closed
palutz opened this Issue Apr 15, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@palutz

palutz commented Apr 15, 2017

When I try to create a class lib with dotnet core and F# on Ubuntu (Linux Mint), it looks like I cannot create the lib with a different Fx than the default while I can do it with C#.
If I write something like this:

$ dotnet new classlib -f netcoreapp1.0 -lang F# -o ./libTest/

or like this

$ dotnet new classlib -f netcoreapp1.1 -lang F# -o ./libTest/

I always get an error sayng:

Invalid input switch:
-f

While if I write like this:

$ dotnet new classlib -f netcoreapp1.1 -o ./libTest/

All works fine (but it will be a C# proj).

If I want to still use -lang F# option, I can remove the -f option and create with the default fx (.Net Standard 1.6) and then manually change the generated .fsproj with these lines:

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

This is my machine data:

Microsoft .NET Core Shared Framework Host

Version : 1.1.0
Build : 928f77c4bc3f49d892459992fb6e1d5542cb5e86

Distributor ID: LinuxMint
Description: Linux Mint 18.1 Serena
Release: 18.1
Codename: serena

@enricosada

This comment has been minimized.

Show comment
Hide comment
@enricosada

enricosada Apr 19, 2017

Contributor

@palutz hi, yes netstandard1.6 was the only option. and was hardcoded in the template (so -f wasnt supported).
btw f# lib template (like the others bundled) are in https://github.com/dotnet/templating/blob/rel/vs2017/post-rtw/template_feed/Microsoft.DotNet.Common.ProjectTemplates.1.x/content/ClassLibrary-FSharp/Company.ClassLibrary1.fsproj

With sdk 1.0 each template had to use a fixed list of supported target framework (-f), but i forgot to add that in the 1.0 templates.

Now with $(TargetFrameworkOverride) template property is easier to add more,

It's fixed with dotnet/templating@a3e41f9#diff-a030b9cbe845f5324f44c81483fd56fa who support any -f

As you said, workaround is to update the fsproj after is generated.

Closing because can be fixed only with a new release of dotnet/cli (the common templates are bundled in dotnet cli), and next one will contains updated templates anyway.

Contributor

enricosada commented Apr 19, 2017

@palutz hi, yes netstandard1.6 was the only option. and was hardcoded in the template (so -f wasnt supported).
btw f# lib template (like the others bundled) are in https://github.com/dotnet/templating/blob/rel/vs2017/post-rtw/template_feed/Microsoft.DotNet.Common.ProjectTemplates.1.x/content/ClassLibrary-FSharp/Company.ClassLibrary1.fsproj

With sdk 1.0 each template had to use a fixed list of supported target framework (-f), but i forgot to add that in the 1.0 templates.

Now with $(TargetFrameworkOverride) template property is easier to add more,

It's fixed with dotnet/templating@a3e41f9#diff-a030b9cbe845f5324f44c81483fd56fa who support any -f

As you said, workaround is to update the fsproj after is generated.

Closing because can be fixed only with a new release of dotnet/cli (the common templates are bundled in dotnet cli), and next one will contains updated templates anyway.

@enricosada enricosada closed this Apr 19, 2017

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