Running ASP.Net core on Tomcat for Rest-API

Henrik1995 21 Reputation points
2022-03-14T12:11:44.497+00:00

Hello,
i want to create a Rest-API between my program and a database. My task is it to use ASP.Net and Tomcat as the webserver.
I didnt find any good answer for this combination, but many comments say that it is not possible to run asp.net programs with apache tomcat.
In my opinion i should better use asp.net core with Microsoft IIS. Maybe someone can tell me the right or better way to implement it.

Thank you very much!

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,346 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,139 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,412 questions
0 comments No comments
{count} votes

Accepted answer
  1. Zhi Lv - MSFT 32,006 Reputation points Microsoft Vendor
    2022-03-15T01:44:33.253+00:00

    Hi @HenrikWaschke-5013,

    The Tomcat (Apache Tomcat) is Java exclusive, so it won't run anything .NET Core based.

    To deploy and host the Asp.net core application, you can choose:

    Refer this article: Host and deploy ASP.NET Core.

    Then, after deploy and host the API application, you can access the API method in another application, such as a Java application.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Dillion

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 55,041 Reputation points
    2022-03-14T14:56:29.573+00:00

    For tomcat to host .net core you would use it as a reverse proxy, just as you would with Apache. Ngnix is a more common approach for a reverse proxy. In both cases you will need a startup application for the core app, like launchd.

    If hosting .net core on windows, IIS is the common choice as it manages startup and error recovery.

    Note: tomcat only natively hosts Java apps. You would configure .net core support similar to its node.js support.