devdigest // dot net
4.03K subscribers
168 photos
3 videos
5 files
2.62K links
Главные новости из мира .NET

Все про C#, F# и VB
Download Telegram
Forwarded from Keanu Reeves
Всем привет!

Шпаргалка, как запустить .NET Core 2.1 WebAPI приложение нативно без dotent на примере ubuntu (18.04 LTS X64):

1) dotnet publish --configuration Release --framework netcoreapp2.1 --runtime ubuntu.18.04-x64
2) sudo nano /etc/systemd/system/kestrel-test.service
[Unit]
Description=.NET Core 2.1 native build Web API application running on Ubuntu

[Service]
WorkingDirectory=/home/user/projects/asp.net/core/test-lesson/bin/Debug/netcoreapp2.1/publish #путь к publish
ExecStart=/home/user/projects/asp.net/core/test-lesson/bin/Debug/netcoreapp2.1/publish/name-of-native-image # путь
Restart=always
RestartSec=5 # Перезапускать сервис через 10 секунд при краше приложения
SyslogIdentifier=dotnet-native-example
User=root # пользователь, под которым следует запускать ваш сервис
Environment=ASPNETCORE_ENVIRONMENT=Production

[Install]
WantedBy=multi-user.target
3) sudo systemctl enable kestrel-test.service
4) sudo systemctl start kestrel-test.service
5) sudo systemctl status kestrel-test.service
The Benefits of Using a YT Audio to MP3 Converter