Force dotnet CLI in English on a French Windows - .net-core

I'm French, and like to have the Windows UI in French, but all my dev tools in English.
The dotnet CLI tool displays its output in French, and I'd like to force it to English. Is it possible?

You can use the DOTNET_CLI_UI_LANGUAGE environment variable to override the language used by the dotnetCLI:
> set DOTNET_CLI_UI_LANGUAGE=en
> dotnet --help
…
[english content]

For unix-like system (Mac OS X, Linux)
set DOTNET_CLI_UI_LANGUAGE=en
dotnet --help
For Windows
setx DOTNET_CLI_UI_LANGUAGE en
Goto "dotnet-install-directory\sdk\sdk-version" (For example C:\Program Files\dotnet\sdk\3.1.102 in windows for dotnet version 3.1.102)
Delete folder of your language
for example, delete fr because your dotnet show French.
delete zh-Hans and zh-Hant if your dotnet show Chinese.

To set DOTNET_CLI_UI_LANGUAGE environment variable please use:
DOTNET_CLI_UI_LANGUAGE=en in cmd.exe
$Env:DOTNET_CLI_UI_LANGUAGE = "en" in PowerShell

Worked for RU-language too.
setx DOTNET_CLI_UI_LANGUAGE en - partially change the cli language.
And delete or rename folder of your language in "dotnet-install-directory\sdk\sdk-version" that you can get via dotnet --info - changes finally the language to English.

I tried to Martin's answer,but it did not work
After that, i tried followings, it needs to work
Run the command setx DOTNET_CLI_UI_LANGUAGE en
Go to location where dotnet is installed Go to
"dotnet-install-directory\sdk\sdk-version" (For example C:\Program Files\dotnet\sdk\3.1.102 in windows for dotnet version 3.1.102)
Delete folder zh-Hans and zh-Hant

Related

Where are dotnet tools stored by default?

I am using Windows 10 and and dotnet 2.2. When I install a tool like this:
dotnet tool install -g mydotnet-tool
Where does dotnet put this tool? I know you can specify the path on installing a tool but I am looking for the default global dotnet tool path.
According to the docs, the default global installation paths are:
Windows - %USERPROFILE%\.dotnet\tools
Linux/macOS - $HOME/.dotnet/tools
In Windows, this means the full path will be something like:
C:\Users\[User]\.dotnet\tools
Global Tools
According to the docs, the default global installation paths are:
Windows: %USERPROFILE%\.dotnet\tools
Linux/macOS: $HOME/.dotnet/tools
In Windows, this means the full path will be something like:
C:\Users\[User]\.dotnet\tools
Local Tools
Local tools are stored in the global NuGet package folder.
Windows: %USERPROFILE%\.nuget\packages
Mac/Linux: ~/.nuget/packages
In Windows, this means the full path will be something like:
C:\Users\[User]\.nuget\packages

How dotnet build chooses the output name

First, let me explain the problem that causes this question.
If I create a new project using dotnet new and specifying a random project name with -n arg, then after doing dotnet restore - dotnet build from default bash terminal -> the final output name is always React + .output_type. Like:
/bin/Debug/netcoreapp2.0/React.dll
I don't specify any additional arguments with dotnet commands. And looks like it doesn't matter what type of project to select: I have tried with console and webapi.
But I have found that if I open the project in VS Code and do the same dotnet build command from VS Code terminal (that is also bash) -> the output name is correct and equal to the project_name+.output_type.
So before I thought that output name is always taken from .csproj file name during building. But now it looks like something could override this behavior: different terminals - different env settings, etc.
Cause output name contains React I am blaming the react cli tooling, but this doesn't help me with identifying the reason of name-override.
I did dotnet --info from both terminals and output was the same:
.NET Command Line Tools (2.0.0)
Product Information:
Version: 2.0.0
Commit SHA-1 hash: cdcd1928c9
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.0.0/
Thanks to #MartinUllrich, I have found that $TARGETNAME variable overrides the project name. Removing variable fix the problem:
> unset TARGETNAME

How to restore an ASP.NET Core project with Ubuntu

Recently, I created an asp.net core project using Visual Studio Code on Windows and pushed it to GitHub. When I cloned the repo from GitHub and attempted to do a dotnet restore on the project on Ubuntu, an error message stating there was no project.json file was returned. Can anyone point me to a resource that will show me how to properly restore a .net core project from a Linux machine? Thanks!
So it seems like on each of your machines you are running different versions of the .net core SDK.
A big caveat with what you are trying to do. Are you trying to use Project Rider from Jetbrains on Linux? This only works with project.json (As of the time of this post) so be wary of that.
Now there are two ways to do this. If you are wanting the very latest on Linux and don't care about using Rider, then you can go here : https://github.com/dotnet/core/blob/master/release-notes/download-archive.md and download the latest release for both Linux and Windows, install on both and you should be good to go.
If you do care about using Rider or you aren't ready to be strapped in for the wild ride of the latest release. Then you can do the following.
Find what version of the SDK you have on linux by typing into a terminal the following :
dotnet --version
This will spit out what version you have on linux. Go here and download the same version for windows and install it on your windows machine (https://github.com/dotnet/core/blob/master/release-notes/download-archive.md).
Now BEFORE you create a project, create a solution folder and create a file in it called global.json. Inside that put the following :
"sdk": {
"version": "1.0.0-preview2-003131"
}
Where the SDK version matches what you got from your linux terminal. Now create a folder for your project inside the solution folder. Run "dotnet new -t web" or a similar command to create your project. It will inspect the SDK version of the global.json and create a project with the tooling that matches. You should then be able to shift this project around any machine that has the same SDK installed, even if it also has the latest SDK's also.
If you do not create the global.json, it defaults to the latest version (Atleast on Windows).
Read a bit more about it here : http://dotnetcoretutorials.com/2017/02/17/developing-two-versions-net-core-sdk-side-side/

VS Code, OmniSharp: Project has these unresolved references:

I'm trying out Asp.Net Core and MVC 6 running on Mac OS X. After I've updated and installed everything it seems to be working pretty good. I can run a website with 'dnx web' that's been generated by Yeoman.
OmniSharp starts correctly but displays this message,
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Project /Users/myname/AspNetCoreProjects/test1/project.json has these unresolved references: Microsoft.AspNet.Diagnostics, Microsoft.AspNet.IISPlatformHandler, Microsoft.AspNet.Mvc, Microsoft.AspNet.Mvc.TagHelpers, Microsoft.AspNet.Server.Kestrel, Microsoft.AspNet.StaticFiles, Microsoft.AspNet.Tooling.Razor, Microsoft.Extensions.Configuration.FileProviderExtensions, Microsoft.Extensions.Configuration.Json, Microsoft.Extensions.Logging, Microsoft.Extensions.Logging.Console, Microsoft.Extensions.Logging.Debug
I've tried to run 'dnu restore' several times. And it seems to succeed. It writes a lock file and so on. But for some reason OmniSharp / VS Code doesn't seem to find any references (except my own classes) at all.
It feels like I'm having the same problem described here,
http://tech.genericwhite.com/visual-studio-2015-net-5-rc1-dnu-restore-asp-dot-net-missing
But that didn't work for me.
Any idea is very helpful!
To start, install the runtime:
//to install coreclr
dnvm install latest -r coreclr -a coreclr-latest
//to install the clr
dnvm install latest -a mono-latest
dnvm alias default [coreclr-latest | mono-latest] //depends on what you installed
dnvm use default
Let me know the output of ls -l ~/.dnx/runtimes/dnx-{your_coreclr_version}/bin | grep dn once you've ran those commands.
This is what your runtimes folder should look like:
I'm also writing a 5 five part tutorial on how to use ASP.NET Core along with with JSPM, TypeScript, etc as the frontend. If you don't care much for that you can take a look at the backend part (part 3) here:
http://ahoycoders.com/2016/03/29/jspm-with-systemjs-es6-angularjs-typescript-and-asp-net-core-part-3-backend/
This part focuses on installing and running ASP.NET Core on MacOS.
Let me know how it goes :)
EDIT: One thing I forgot to mention, before running dnu restore again remove "dnx451": {}, from your project.json
EDIT2: Make sure you install the coreclr option. From your post it seems you want to use ASP.NET Core

qtcreator examples not enabled

I installed qtcreator on a Ubuntu 11.10
sudo apt-get install qtcreator
the versions installed are: QT Creator 2.2.1, QT 4.7.3
When i start qtcreator, to explore QT C++ examples the button is greyed out/disabled and it says Examples not installed.
Neither does qtdemo show any demo/documentation?
Do i have to install examples, doc separately? If yes, how?
How can i enable examples in qtcreator and documentation in qtdemo?
EDIT:
In response to one answer below from #Murtuza Kabul, I tried many things to point qtcreator to correct qt but could not. So I did uninstall qtcreator and qt-sdk and reinstalled qt-sdk. So now qtcreator is what comes with qt-sdk . It still says examples not installed.
I downloaded Qt 5.1 directly from qt-project.org and installed as admin (with sudo) on Linux Mint 12 (based on Ubuntu).
If I started qtcreator as normal user I didn't have examples but if started qtcreator as admin (with sudo) I had all examples.
My problem was with examples folder privilages. It was the only folder without read/execute privilage for all users (/opt/Qt5.1.0/5.1.0/gcc/examples). All other folders inside (and outside) examples had privilages for all users.
EDIT:
I forgot to say - as HostileFork mentioned in comment - sudo chown -R +rx /opt/Qt/5.1.0/gcc/examples was solution to this problem.
EDIT:
As noted by Climax - it should be chmod instead of chown
sudo chmod -R +rx /opt/Qt/5.1.0/gcc/examples
You also need to install qtsdk. It comes with the examples and binaries required to run the qt project. If you install the sdk, it will provide you an interface to update the sdk and install/uninstall different parts of the sdk whereby you will be able to choose if you want to install the examples or not
Install the qt4-demos package.
sudo apt-get install qt4-demos
I found the sample code installed in /usr/lib/qt4/demos/. Also the qtdemo program was installed at /usr/lib/x86_64-linux-gnu/qt4/bin/qtdemo.
It seems only a limited set of examples are installed by this package.
I had the same problem on Windows 7.
How I solved this:
I open QT Creator.
I select menu-option [Tools]
From there I select [Options...]
From there I select the [Kits] option on the left-hand side
I select the tab [QT Versions]
I click The [Add...] button: to add the QT version that I am using...
... I am presented with a windows-explorer screen to select something...
... I go to the main directory on which QT is installed (in my case: C:\Qt)...
... In the explorer "Search" I enter qmake (without the quotes)...
... There is a single qmake EXECUTABLE file displayed - I double-click it!...
... I press [Apply], then [OK].
Walla - it works! I now have examples!

Resources