docker container exits immediately even with Console.ReadLine() in a .NET Core console application

后端 未结 9 1626
一个人的身影
一个人的身影 2020-12-09 15:43

I am trying to run a .NET Core 1.0.0 console application inside a docker container.
When I run dotnet run command from inside the Demo folder on my machin

9条回答
  •  伪装坚强ぢ
    2020-12-09 15:53

    You can use:

    Thread.Sleep(Timeout.Infinite);
    

    See this answer:

    Is Thread.Sleep(Timeout.Infinite); more efficient than while(true){}?

提交回复
热议问题