centos 部署.NET CORE
由于公司多語言开发,所以需要.NET Core部署
记录下遇到的问题
部署按照https://docs.microsoft.com/zh-cn/dotnet/core/install/linux-centos 微软官方文档部署。
.NET CORE 显示不出验证码的问题
yum install libgdiplus-devel
守护进程
vi /etc/systemd/system/xxx.service
[Unit]
Description=AspnetCore running on Centos
[Service]
WorkingDirectory=/www/xxx
ExecStart=/usr/bin/dotnet /www/xx/xxx.Web.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=AspnetCore
User=root
#Production:生产环境 Development:开发环境
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target
chmod -R 777 xxxNetCore.service
systemctl enable xxxNetCore.service
systemctl start xxxNetCore.service
发布步骤
发布文件覆盖项目文件
service xxxNetCore restart