To help raise the quality of your code, Microsoft introduced a way to run Remote Testing in Visual Studio where you can add all sorts of environments.
Since all code starts out locally, it is nice to verify tests manually before pushing to CI/CD flows - especially because there more often than expected are differences between Windows, Linux and even WSL (even if they use the same distro).
For this reason, consider adding a testenvironments.json
to the root of your repository and add this snippet to it:
{
"version": "1",
"environments": [
{
"name": "WSL-Ubuntu",
"type": "wsl",
"wslDistribution": "Ubuntu-24.04"
},
{
"name": "Docker-Ubuntu",
"type": "docker",
"dockerImage": "gimlichael/ubuntu-testrunner:net8.0.407-9.0.202"
}
]
}
{
"version": "1",
"environments": [
{
"name": "WSL-Ubuntu",
"type": "wsl",
"wslDistribution": "Ubuntu-24.04"
},
{
"name": "Docker-Ubuntu",
"type": "docker",
"dockerImage": "gimlichael/ubuntu-testrunner:mono-net8.0.407-9.0.202"
}
]
}
You can find populated Docker images under my account: https://hub.docker.com/r/gimlichael/ubuntu-testrunner/tags or build your own from the embedded Dockerfile.
Happy testing!