Ubuntu build .Net Core MVC project environment and publish

Support Environment

1. Windows 10 1809 December update version (other versions should also work, but suggested that no less than 1809, low version may not install subsystem ubuntu18.04 LTS)

2. ubuntu 18.04 LTS (herein employed to achieve subsystem linux Windows 10, is not separately installed in the virtual machine and the physical machine)

Install linux subsystem

1. Open the windows Developer options 10 (in Windows updates and security → Settings → Developer options)

 

 

 

2. Open the Control Panel to enable win10 "Linux subsystem features for Windows," Bahrain to restart the system.

 

 

3. After the restart open windows app store, search ubuntu, results shown in Figure.

 

 

 4. Select the second "ubuntu 18.04 LTS" installation, the installation is complete click Start. 

 

 Note: You can find the actual location ubuntu18.04 installation is C: \ Users \ xyhs \ AppData \ Local \ Packages \ CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc \ LocalState \ rootfs 

(This step requires the function to open windows show hidden files, below)

 

The current user's home directory is  C: \ the Users \ xyhs \ AppData \ Local \ Packages Standard Package \ CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc \ LocalState \ rootfs \ Home \ xyhs , which xyhs is my username, that you want to install the process in accordance with enter the name to determine, since a while we will use this path, right-click on the desktop shortcut to send it to:

 

Double-click to open the shortcut, and this is the files in the current user (to. Beginning representatives hidden)

 

 

6.  After starting the need to wait and enter a user name and password twice ( Linux user name and password, just lost on the line, but to remember ), then enter the terminal.

 

We can enter a command to create a new folder try to enter mkdir test

 

Here to see the current directory already have this folder, go look at the actual directory, as shown below

 

 

You can see, this has been a new directory folder test, then install linux ended.

 

.net core operating environment configuration under ubuntu

1. Before using ubuntu to update their systems

Enter Enter sudo apt update  - update software source  

Enter a password

Enter Enter sudo apt upgrade - Software Updates

Enter sudo apt dist-upgrade Enter  - can be understood as less secure update it, he can rely on software updates together

These processes vary according to the time your network environment, you need to wait

2. order execution

wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

Prompted to install the input .dotnet-sdk-2.2 Y

3.  Enter dotnet new look after the installation is complete --list own template as

 

4. part red box logo, is the name, we can use this name to create a template project, for example, we first create a template mvc project demo1, enter dotnet new mvc -n demo1

 

5. The establishment of the success of our operation facie effect

Enter cd demo1

Enter dotnet run

You can see the prompt, you can visit http windows in the browser: // localhost: 5000 Access facie effect

We can see a successful visit, but the interface is a little low, but there is no problem running.

Publish their own projects

1. they have posted good .Net Core project copying personal files under ubuntu folder (a shortcut to build on that)

 2. Type cd publish will be prompted to insufficient permissions as shown in ubuntu interrupt

 

 Input chmod 777 -R publish FIG.

 Enter cd publish again

You can see the change permissions through access to this folder

3. Enter dotnet WebApplication1.dll

 Show this page proved successful operation

 

 Original link: https://blog.csdn.net/zpczmc/article/details/86653909

Guess you like

Origin www.cnblogs.com/w821759016/p/12530728.html