none
Running .NET app in a Docker container RRS feed

  • Question

  • Hi,
    I try to run my .NET application in an Mono Docker image. I created docker file with the following content:

    FROM mono:latest
    COPY /_build/debug/mydocker :/mydocker
    WORKDIR /mydocker
    ENTRYPOINT [“mono”, “./MyApp.exe”]

    From the Powershell I invoked the following commands:

    PS C:\Users\myUser> docker build .
    PS C:\Users\myUser> docker tag 44ae8b30b2c3 mydocker
    PS C:\Users\myUser> docker run -i -t -p 8000:8000 --name test mydocker

    Listing all docker containers I get the status code “Exited (2)”. I used google to find out the meaning of Status Code 2 and had found the hint, that something failed running my application (MyApp.exe).
    How can I get more informations about the reason?
    How can I get Exceptions or error messages, that where thrown during the start phase?
    Best regards,
    Christian

    Sunday, December 8, 2019 3:15 PM

All replies

  • (MyApp.exe) what kind of program is it?
    Sunday, December 8, 2019 4:27 PM
  • Hi ChristianHavel,

    Thank you for posting here.

    Since this thread is related to Docker, it is a third-party product, we only provide support for Microsoft related products.

    I suggest that you can ask this question in DOCKER COMMUNITY FORUMS.

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best Regards,

    Timon



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 9, 2019 6:52 AM
  • Hi,

    it is a console application.

    Thanks and regards,
    Christian

    Monday, December 9, 2019 12:45 PM
  • Hi,

    it is a console application.

    Thanks and regards,
    Christian

    http://www.tutorialspanel.com/create-a-global-error-handler-in-c-for-a-console-application/

    Then you may have to implement what is in the link to catch the unhandled exception.

    Monday, December 9, 2019 7:21 PM
  • Hi,

    thanks for yours response.

    Christian

    Wednesday, January 22, 2020 2:49 PM