2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Raspberry Pi で .Net の Web アプリケーションを publish

Last updated at Posted at 2019-12-29

次のバージョンで確認しました。

$ dotnet --version
6.0.302

こちらで作成したプロジェクトを publish する方法
です。

Raspberry Pi で .Net Core の Web アプリケーションを作成

1: appsettings.json の修正
  localhost 以外からもアクセスできるようにする。

appsettings.json
{
"urls": "http://*:5000",
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}

2: publish (bin/Release 以下にリリース版を作成)

$ dotnet publish -c Release
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  Web01 -> /home/uchida/tmp/Web01/bin/Release/net6.0/Web01.dll
  Web01 -> /home/uchida/tmp/Web01/bin/Release/net6.0/publish/

3: Kestrel サーバーを実行

$ dotnet bin/Release/net6.0/Web01.dll
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://[::]:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /home/uchida/tmp/Web01/

4: ブラウザーで http://host:5000/ にアクセス

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?