"ASP. NET" Linux deployment ASP. NET Core Project

Source: Internet
Author: User
Tags dotnet

Net SDK website Linux configuration address: https://www.microsoft.com/net/core#windows

Reference: http://www.07net01.com/2016/08/1638058.html

Http://www.cnblogs.com/calvinK/p/5628298.html

Http://www.mamicode.com/info-detail-1535706.html

Http://www.cnblogs.com/ants/p/5732337.html

1, Project release 1.1, use VS2015 release project

Note: Many tutorials on the internet say you want to configure runtimes blocks in Project.json, delete Microsoft.NETCore.App "node

"Type": the configuration of "platform", as long as the version node. Test does not need to delete also can

1.1.1 Online Search for tutorials
  1. Delete the configuration of "type": "Platform" in the "MICROSOFT.NETCORE.APP" node
  2. The corresponding platforms in the "runtimes" node are added as follows:
  3.  "runtimes": {//Join Runtime    "win7-x64": {},    "win7-x86": {},    "osx.10.10-x64": {},    "osx.10.11-x64": {},    "ubuntu.14.04-x64": {},    "centos.7-x64": {}  }

  4. The modified "Project.json" is as follows:

1.1.2 Self-Test through 1, modify the Project.json file Publishoptions node, modified as follows: Here the modified release is published when you add your view, controller, etc. (all folder names), according to their own project structure modification. I'm here to add a folder of my own defined interface class
"publishoptions": {    "include": [      "wwwroot",      "Controllers",      "irepositories",      "Models",      " views",      "Web. config"    ]  }
2, in this I only modified the Publishoptions node, the other do not modify, right click on the project selection to publish:

3, click on the post-publishing interface, select Customize and enter your configuration name (name in the definition), click to confirm the next step directly

4, publish method Select File system, the target location select the place you want to post the save, you can click Publish, the following settings remain the default

2. CentOS7 deployment project in Linux system

Note: Other Linux system from Microsoft Official website to find configuration command, address: https://www.microsoft.com/net/core#windows

2.1.sudo yum install libunwind libicu(Installation Libicu dependent)

2.2, Curl-ssl-o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=809131 (Download SDK compression package)

2.3. sudo mkdir-p/opt/dotnet && sudo tar zxf dotnet.tar.gz-c/opt/dotnet (unzip)

2.4. Sudo ln-s/opt/dotnet/dotnet/usr/local/bin (create link)

Enter Dotnet–info to see if the installation was successful and, if possible, to indicate that the. NET Core SDK was installed successfully

3. Project operation

3.1. Create the Wwwroot folder under the Linux directory Home (the folder name can be customized).

3.2. Upload the published project to the wwwroot created above

3.3, use the command dotnet your project path/oneaspnetcore.dll run the project: OneAspNetCore.dll This is the DLL file that was generated after my project was published, Oneaspnetcore is the name of my project.

After running successfully, you can use the browser input on the Linux server: localhost:5000 access the project, INFO info hint Here don't care about it

Note: You cannot do other actions or press CTRL + C to exit after executing the dotnet command, otherwise the project will stop running

3.3.1, run the project with error version:

3.3.2, fix Error: Change Microsoft.NETCore.App version information of dependencies node in Project Project.json file, you can also upgrade the SDK version of the server, modify the following:

" Microsoft.NETCore.App " : {      "version""1.0.1",//  Change the version number to 1.0.0      "type" "platform "     },

You may not be able to access the browser after access, log the error message:

There are two possibilities when the following error occurs:

1, the project is not published in the Project.json file publishoptions node configuration view, controller, etc., check whether the configuration, modify and republish the project to the server, configured as follows:

 "publishoptions": {    "include": [      "wwwroot",      "Controllers",      "irepositories",      "Models",      " views",      "Web. config"    ]  }

2, when the first step check has been configured, the project also run successfully is not access! WORKAROUND: Use the command cd/home/wwwroot/dev/in the project folder to execute dotnet OneAspNetCore.dll

In the Open server browser access can be accessed, this problem is found on the internet to say is a permission problem!!!

Note: The above deployment can only be accessed internally, the external access configuration needs to configure the Nginx service configuration address: http://www.cnblogs.com/ants/p/5732337.html

"ASP. NET" Linux deployment ASP. NET Core Project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.