Skip to content

Conversation

enricosada
Copy link
Contributor

@enricosada enricosada commented Feb 18, 2020

Read DOTNET_NEW_PREFERRED_LANG as default language for dotnet new.
If not set, the default continue to be C#

Currently to create F# projects, we need to specify -lang f# foreach dotnet new invocation.
It's really annoying, and atm dotnet new doesnt yet support set the preference property.

This option can be removed later, when dotnet new support set the default language (as normal config)

With this pr

set DOTNET_NEW_PREFERRED_LANG=F#
dotnet new console
dotnet new lib

/cc @cartermp

ref #4224

@enricosada
Copy link
Contributor Author

enricosada commented Feb 18, 2020

For .NET Core Sdk 3.1.2xx is implemented in PR dotnet/cli#13237

It will be awesome to have it in the next LTS sdk 3.1.200 .
I tried find the correct branch in dotnet/cli and dotnet/sdk and dotnet/toolset, i hope i got the right repo/branch.
If is not the right place i'll rebase/move it.

@enricosada enricosada force-pushed the dotnet_new_default_fsharp/5.x branch from 4b607cc to ebc7cb7 Compare February 18, 2020 11:08
@enricosada enricosada closed this Feb 18, 2020
@enricosada enricosada reopened this Feb 18, 2020
typeof(NupkgUpdater).GetTypeInfo().Assembly
});

string preferredLangEnvVar = Environment.GetEnvironmentVariable("DOTNET_NEW_PREFERRED_LANG");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest renaming this to preferredLangEnvVarValue

@dsplaisted dsplaisted merged commit 647e1d9 into dotnet:master Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants