How to set an automatic pause at the entrypoint of an app in container for remote debugging?

I’m doing remote debugging in container. I have msvsmon.exe installed and running in container and I know how to attach the running process in Visual Studio. However, my entry app executes and exits very fast before I can attach it to local VS. Is there a method to set an automatic pause in the Main method of the app to give me time to attach it? I don’t want to set sleep because I don’t want that to appear in production. My app is C# app and I’m using VS2017. Any hints are very welcome and will be helpful.

Source: StackOverflow