8000 GitHub - kinggod/ApliuCoreWeb: 个人兴趣网站,包含手机端、微信公众号等内容以及小工具等等,演示地址:https://apliu.xyz,由ApliuWeb转型到asp.net Core框架 · GitHub
[go: up one dir, main page]

Skip to content
{"props":{"color_mode":"dark","logged_in":false,"marketing_page":false,"home_path":"/","login_path":"/login?return_to=https%3A%2F%2FgitHub.com%2Fkinggod%2FApliuCoreWeb","signup_path":"/signup?ref_cta=Sign+up\u0026ref_loc=header+logged+out\u0026ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E\u0026source=header-repo\u0026source_repo=kinggod%2FApliuCoreWeb","signup_enabled":true,"is_signup_controller":false,"show_search_and_nav":true,"hide_search":false,"private_mode_enabled":false,"should_use_dotcom_links":true,"auth_hydro_click":"{\"event_type\":\"authentication.click\",\"payload\":{\"location_in_page\":\"site header menu\",\"repository_id\":null,\"auth_type\":\"SIGN_UP\",\"originating_url\":\"https://gitHub.com/kinggod/ApliuCoreWeb\",\"user_id\":null}}","auth_hydro_click_hmac":"143e0c22b813b2f8d01abadb65f6a305689e5d34d44b790575f4a02a49bd472d"}}

About

个人兴趣网站,包含手机端、微信公众号等内容以及小工具等等,演示地址:https://apliu.xyz,由ApliuWeb转型到asp.net Core框架

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

ApliuCoreWeb

个人兴趣网站,包含手机端、微信公众号等内容以及小工具等等,演示地址:https://apliu.xyz,由ApliuWeb转型到asp.net Core框架

CentOS 安装 core 2
1.安装libicu依赖
yum install libunwind libicu
2.添加dotnet product feed
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[packages-microsoft-com-prod]\nname=packages-microsoft-com-prod \nbaseurl= https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/dotnetdev.repo'
3.安装core SDK
sudo yum update
sudo yum install libunwind libicu
sudo yum install dotnet-sdk-2.1.4 安装SDK环境

备注--sudo yum install dotnet-runtime-2.0.6 安装运行时环境或者sudo yum install aspnetcore-runtime-2.1.2

其他系统安装,请参照:https://www.microsoft.com/net/download/linux-package-manager/centos/runtime-current

切记:运行机器上的core版本一定要高于或等于发布机器上的版本,否则会出现错误,当然也可以使用独立模式部署,单独使用core运行时
"Error: An assembly specified in the application dependencies manifest (..deps.json) was not found: package: ‘Microsoft.AspNetCore.Antiforgery‘, version: ‘2.0.3‘ path: ‘lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll‘ This assembly was expected to be in the local runtime store as the application was published using the following target manifest files: aspnetcore-store-2.0.8.xml "

Linux 运行 dotnet core web

指令: dotnet restore dotnet publish dotnet run dotnet xxxx.dll

为防止ssh工具界面关闭后导致服务停止,加上指令(xxxx为具体执行指令):nohup xxxxxx &

  1. Program.cs 方法添加[.UseUrls("http://0.0.0.0:8000")],不然会出现只监听127.0.0.1,外网无法访问

public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseUrls("http://0.0.0.0:8000") .UseStartup() .Build();

  1. xxxxx.csproj项目文件添加上 "false",否则可能会出现错误: "Error: An assembly specified in the application dependencies manifest (..deps.json) was not found: package: ‘Microsoft.AspNetCore.Antiforgery‘, version: ‘2.0.3‘ path: ‘lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll‘ This assembly was expected to be in the local runtime store as the application was published using the following target manifest files: aspnetcore-store-2.0.8.xml "

" netcoreapp2.0 false "

  1. SSH工具推荐使用Bitvise SSH Client

  2. 发布的时候注意点,稳妥起见 部署模式:独立 目标运行时选择对应的环境

  3. 框架依赖的可移植模式发布,发布目录仅仅包含项目文件而不包含运行时文件,所以出现错误,可能是需要进行其他配置才能启动。(出错原本是版本过低)

About

个人兴趣网站,包含手机端、微信公众号等内容以及小工具等等,演示地址:https://apliu.xyz,由ApliuWeb转型到asp.net Core框架

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0