DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Top Three Methods for iOS Development on Linux
  • Boosting Efficiency With Cross-Platform Code-Sharing Techniques
  • Troubleshooting, Dynamic Logging, and Observability for .Net — A New Kid on the Block
  • The Cypress Edge: Next-Level Testing Strategies for React Developers

Trending

  • Scaling Mobile App Performance: How We Cut Screen Load Time From 8s to 2s
  • Artificial Intelligence, Real Consequences: Balancing Good vs Evil AI [Infographic]
  • Kubeflow: Driving Scalable and Intelligent Machine Learning Systems
  • Measuring the Impact of AI on Software Engineering Productivity
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Using Remote Testing With .NET Core

Using Remote Testing With .NET Core

In this article, we'll learn how to run Linux tests right from Visual Studio by connecting the Test Explorer to a remote environment.

By 
Max Raza user avatar
Max Raza
·
Feb. 02, 22 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
5.6K Views

Join the DZone community and get the full member experience.

Join For Free

It's no secret that .NET Core is becoming increasingly popular. As a result, more developers are creating .NET applications on Windows and then deploying them on Linux. This trend is understandable, as there are many differences between these platforms. 

For this reason, it's important to run your debugging tests directly on Linux to avoid errors in production. But using Docker to debug your application on Linux can be tricky and time-consuming, and setting up a remote SSH connection can be challenging if you haven't done it before.

Cross-Platform Development Is Hard

Until now, remote debugging on Linux has given you some pretty crummy options. You could use SSH to forward ports or try to virtualize the WSL and run it in a VM on your desktop. Neither is a great option, and neither is particularly efficient. Remote testing enables Visual Studio 2022 to run and debug tests on remote machines, across different operating systems. This capability is great for cross-platform developers who deploy code to multiple different target environments such as different Windows or Linux operating systems.

Get Started With Remote Testing

To get feedback from your Linux tests, normally you'll have to push the changes to your project on a continuous integration server. With this feature, you can do that right from Visual Studio. Now, you can connect your Test Explorer directly to a remote Linux system, so that you can get faster feedback on your builds from Linux tests. Pre-requisites for remote testing as stated by Microsoft are Visual Studio 2022 Update 17.0 Preview 3 or later and is currently available only for .NET tests targeting Ubuntu, Windows, or Debian images in the remote environment.

Set Up the Remote Testing Environment

Environments are specified using testenvironments.json the root of your solution. The JSON file structure follows the schema described here:

JSON
 
{
"version": "1",
"environments": [
    {
    "name": "linux dotnet-core-sdk-3.1",
    "type": "docker",
    "dockerImage": "mcr.microsoft.com/dotnet/core/sdk"
    }
]
}


Targeting Multiple Distributions

If you have an application designed to run across multiple Linux distributions, you can use multiple launch profiles to test it quickly on each distribution. For example, if you are testing your console app on Debian, Ubuntu 18.04/20.04, you can use the launch profiles mentioned below:

JSON
 
"WSL 2 : Debian": {
    "commandName": "WSL2",
    "distributionName": "Debian"
},
"WSL 2 : Ubuntu 18.04": {
    "commandName": "WSL2",
    "distributionName": "Ubuntu-18.04"
},
"WSL 2 : Ubuntu 20.04": {
    "commandName": "WSL2",
    "distributionName": "Ubuntu-20.04"
}


Use the Test Explorer To Run and Debug Remote Tests

To run tests, use a drop-down in the Test Explorer toolbar. Right now, only one test environment can be active at a time. Once an environment is selected, tests are discovered and run in the new environment. You can configure your remote environment to fit your own preferences.

Future of Web?

As the two worlds of Linux and Windows continue to converge, it's interesting to imagine what the future world of the web will be like. We are building some amazing tools and applications that are cross-platform and deliver the best of both worlds. 

Learn more about these tech stacks to help with your next production-grade web-dev project testing on all platforms you desire to deploy. 

remote .NET Testing Linux (operating system) Cross platform

Opinions expressed by DZone contributors are their own.

Related

  • Top Three Methods for iOS Development on Linux
  • Boosting Efficiency With Cross-Platform Code-Sharing Techniques
  • Troubleshooting, Dynamic Logging, and Observability for .Net — A New Kid on the Block
  • The Cypress Edge: Next-Level Testing Strategies for React Developers

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!