question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support changing the default language

See original GitHub issue

I would like to be able to default the dotnet sdk language to F#. Currently we have to remember to put -lang F# with all standard project templates. I would like to be able to set a global flag that changes the default to F#.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:205
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

11reactions
enricosadacommented, Apr 24, 2020

the DOTNET_NEW_PREFERRED_LANG=F# env var is supported in the latest released .net 5 sdk preview3 ( 5.0.100-preview.3.20216.6 )

C:\temp5>dotnet --version
5.0.100-preview.3.20216.6

C:\temp5>set DOTNET_NEW_PREFERRED_LANG=F#

C:\temp5\5_p3>dotnet new lib -n l1
The template "Class library" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on l1\l1.fsproj...
  Determining projects to restore...
  Restored C:\temp5\5_p3\l1\l1.fsproj (in 106 ms).

Restore succeeded.
7reactions
enricosadacommented, Feb 13, 2020

Another option (smaller implementation but more specific, less bikeshedding) is to use an env var.

That allow a global per user configuration.

I think the dotnet new is something really useful for developers as cli. IDE/editor have their way to specify a default preference. To be scripted programmatically the -lang param should be always passed to be safe

A possible implementation (require rebase) is done in an old PR https://github.com/dotnet/cli/pull/5679

Having that env var doesn’t prevent a more comprensive .netconfig file later, when there is an agreement on this bigger scope

Using current global.json I think is not correct, because current behavior is to stop at first found, so cannot do a shared per user atm.
Another option is allow a per user global.json where I can specify that preference and is always loaded (overrriden by repo specific global.json). Like other tools, a config file in user folder. Maybe call it .net 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the default input language for Windows
In the Text Services and Input Languages dialog box, under Default input language, click the language that you want to use as the...
Read more >
Manage display language settings in Windows
The display language you select changes the default language used by Windows features, such as Settings and File Explorer. Select Start > Settings...
Read more >
Configuring the default language for your help center
Your help center default language is initially set to English. You can change the default language. You can choose from all of the...
Read more >
Change your language on the web - Android
On your Android device, tap Settings Settings . · Tap System and then Languages & input and then Languages. · Tap Add a...
Read more >
Change the language your Mac uses
Change the system language · On your Mac, choose Apple menu > System Settings, click General in the sidebar, then click Language &...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found