© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•12mo ago•
3 replies
Denis

Run ASP.NET Core app in Test Container

I have an ASP.NET Core app that is a server for my WPF UI applications.
The server depends on a SQL database and a NoSQL database.

I wish to perform automated UI tests on my applications while ensuring that the server is clean for each test.
I have discovered Test Containers and I understand that I can spin up containerized instances of the databases.

But can I also use Test Containers to run the ASP.NET Core app?

Why:
- the server depends on environment variables to connect to the databases and for other settings
- the server ensures that only a single instance of it is running on the machine
- I will only have to worry about one exposed port for a test run instance, instead of three - I could attempt to have each individual application be tested in parallel

I think it should be possible, by creating an image of the ASP.NET Core app and then throwing that at Test Containers. But, can I create the image and spin it up directly via the Test Containers SDK? Unfortunately, I was not able to figure out whether that can be done.

Thanks in advance for any advice.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ ASP.NET CORE with React.js or ASP.NET CORE WEB APP
C#CC# / help
3y ago
Database In ASP.Net Core
C#CC# / help
14mo ago