Developing .NET Core on Deepin using Rider
[TOC]
The domestic Deepin is quite good; I’d recommend it.
I've used Deepin for a year or two just for casual use, not for development. Later, I found Windows 10 not very satisfying, so I thought about coding on Deepin. To do development, an IDE is indispensable. I couldn't use VS2019, and VS Code seemed too complicated and cumbersome. Eventually, I discovered the wonderful tool Rider. However, Rider has an English interface, and my English is pretty poor. After using Rider for a while on Windows, I became familiar with it, so I planned to migrate to Deepin for .NET Core development. I installed a dual boot system with Windows 10 + Deepin 15.
Installing Rider
The download link for Rider on Linux:
http://www.jetbrains.com/rider/download/#section=linux
After downloading the compressed package, unzip it. Open the bin
directory, then open a terminal in that directory and run:
sh rider.sh
Or you can directly click on the rider.sh file and select to execute it.
An installation interface will appear afterward.
Follow the prompts to complete the installation.
Finally, you will be asked to enter an account password or activation code to activate Rider.
I have the privilege of a high-achiever~ If you don't have this, you can apply for free usage through open-source projects on GitHub or activate through other means.
After installation, click on New Solution and find that you can only create a .NET Framework project (Mono).
Close Rider first; next, we need to install .NET Core.
Installing .NET Core SDK
There are two installation methods:
- Download the binary installation package yourself.
- Install using a package manager.
In either case, if you don't place the SDK/Runtime under /usr/share/dotnet
, Rider won't recognize it (the default path; you can modify the settings in Rider). The following two methods show how to perform a simple binary installation of the .NET Core SDK on Linux.
sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet -f
export DOTNET_ROOT=/usr/share/dotnet
export PATH=$PATH:/usr/share/dotnet
I recommend the first method; the second method can be tested according to Microsoft's documentation...
https://dotnet.microsoft.com/download/thank-you/dotnet-sdk-3.0.100-linux-x64-binaries
After installation, it should look like this.
If you want to install via package management, refer to this link: https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-04/sdk-current
Experience Development
I was surprised to find out that Rider supports Desktop Application (WPF) on Deepin.
But that's not the focus; I don’t know WPF, so I’ll first try ASP.NET Core and check WPF later.
When running, an error occurred regarding the HTTPS certificate, which can be fixed by opening a terminal in any location and entering the following command.
dotnet dev-certs https
I don’t know why the browser opens the Blazor application as a blank page...
Let’s try with MVC.
I don’t know why Blazor shows a blank page. Never mind, let’s try the Desktop Application.
After creating a WPF project, it prompted me to install a plugin, and then it closed and reopened.
However, reopening the project still showed an error:
Project 'WpfApp1' load finished with warnings
The imported project "/usr/share/dotnet/sdk/3.0.100/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.WinFX.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. /usr/share/dotnet/sdk/3.0.100/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets at (26:3)
Windows is required to build Windows desktop applications. at (59:5)
Forget it~ It’s fine, I don’t know WPF anyway~
This article was written using Typora; very straightforward.
Let's study hard~
Finally, I recorded a video for fun, not sure what to say; just check the content interface.
If you can’t open it, please click: http://player.youku.com/embed/XNDQzODgzMzk3Ng==
文章评论