Then we have to use the ASP. NET core, we need to install the relevant environment, do not say anything, the installation instructions (official documents), select the appropriate version of the good
1. Add The dotnet product feed
Start to install according to official documents, there is a problem to find the official website is correct
[Email protected]:/# Curl HTTPS://PACKAGES.MICROSOFT.COM/KEYS/MICROSOFT.ASC | GPG--dearmor > Microsoft.gpg[email protected]:/# sudo mv microsoft.gpg/etc/apt/trusted.gpg.d/microsoft.gpg
Well, you've succeeded in attracting my attention, and here's a hint that if you don't have curl installed, follow the prompts to install it, and then press "Y" to confirm the selection.
[Email protected]:/# apt Install curl
And then one more time.
[Email protected]:/# Curl HTTPS://PACKAGES.MICROSOFT.COM/KEYS/MICROSOFT.ASC | GPG--dearmor > Microsoft.gpg[email protected]:/# sudo mv microsoft.gpg/etc/apt/trusted.gpg.d/microsoft.gpg
Select the appropriate Ubuntu version
[Email protected]:/# sudo sh-c ' echo ' Deb [ARCH=AMD64] https://packages.microsoft.com/repos/ Microsoft-ubuntu-xenial-prod xenial Main ">/etc/apt/sources.list.d/dotnetdev.list"
2. Install the. NET SDK (with select "Y" confirmation)
[Email protected]:/# sudo apt-get update[email protected]:/# sudo apt-get install dotnet-sdk-2.0.2
3. Create your App (test)
[Email protected]:/# dotnet new console-o myapp[email protected]:/# cd myApp
[Email protected]:/myapp# dotnet Run
See so two lines, can say is quite excited, explain our, no, is my. NET core environment build successfully!!
But what I want is a website? Don't worry, come on.
[Email protected]:/myapp# CD/home[email protected]:/home# dotnet New razor-o aspnetcoreapp[email protected]:/< c2>home# CD aspnetcoreapp[email protected]:/home/aspnetcoreapp# dotnet run
See here I am also very excited, all smooth, red box is listening to the local 5000 port, indicating that the site has been running, and then we will first quit, follow the prompts, CTRL + C can exit, but please note that this is only used for testing purposes
If you want to actually see the Web page on your browser, Let's go to the next section. install Jexus, then go!
(a) 2, install. NET Core