要約:dotnet run
として機能しますが、dotnet myappname.dll
として機能しません。Kestrelエラー:アドレスは既に使用中(ドットネットコア)
(スコットHanselman氏からthis tutorial以下)自分のLinuxスキルが限られているが、私は、私は物事を混同しないように本を読んで行くしようとしています:
$ cd /home/myusername/dotnettest
$ dotnet run
Now listening on: http://localhost:5123
その後、私はそれを移動します/ varそうのように:最後に
$ sudo cp -a /home/myusername/dotnettest/bin/Debug/netcoreapp1.1/publish /var/dotnettest
私はそれがそこにも動作するかどうかをテスト:
$ dotnet dotnettest.dll
そして、それは失敗します。
info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]
User profile is available. Using '/home/myusername/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
Unhandled Exception: System.AggregateException: One or more errors occurred. (Error -98 EADDRINUSE address already in use) ---> Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -98 EADDRINUSE address already in use
at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.Check(Int32 statusCode)
at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvTcpHandle.GetSockIPEndPoint()
at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.TcpListener.CreateListenSocket()
at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Listener.<>c.<StartAsync>b__6_0(Object state)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelEngine.CreateServer(ServerAddress address)
at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Start[TContext](IHttpApplication`1 application)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.Start()
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host, CancellationToken token, String shutdownMessage)
at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
at WebApplication.Program.Main(String[] args) in /home/myusername/dotnettest/Program.cs:line 27
Aborted (core dumped)
私はnginxのを停止しようとしているに注意してきました。
何かを聞いている場合、私はチェックしました:コマンドを使用して5123:
$ lsof -i tcp:5123
、何も出てくるようです。
'sudo netstat -ltp'の後、' dotnet'プロセスが永久に:5000を聞いているのを見たことがあります(私は何かを実行しましたか?デフォルトのバックグラウンドプロセスがそれをしているとは思わない)。だから、私は 'dotnet dotnettest.dll'をやり直してやっていますが、それは聞きます:5000(5123の代わりに)。私が間違っていたことを確認する必要がありますが、 'Program.cs'で行った変更を考慮しているように見えます(' dotnet run'が期待通り5123を聞いていたので変です)。 –