Create and run a sample .NET application
You can create a basic "Hello World" application to verify that your .NET development tools are properly configured, and then publish and deploy the application by using one of several available methods.
Create an application by using .NET 10.0 Copy linkLink copied!
To verify that your development tools are properly configured, you can create a basic "Hello World" application. This process tests the core functionality of the .NET SDK, which ensures that you can successfully generate, build, and run projects from the command line.
Before you begin Copy linkLink copied!
- Installed .NET 10.0 SDK
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Verify that the application runs and displays the expected output:
Hello World!
Publish .NET 10.0 applications Copy linkLink copied!
To publish a .NET 10.0 application, you can choose one of several deployment methods.
Before you begin Copy linkLink copied!
- A .NET application to publish
About this task Copy linkLink copied!
The following deployment methods are available:
- Self-contained deployment (SCD): The application includes the .NET runtime. This method uses a runtime built by Microsoft.
- Framework-dependent deployment (FDD): The application uses a shared, system-wide version of the .NET runtime.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Verify that the application was published by listing the contents of the
publishdirectory:$ ls <my-app>/bin/Debug/net10.0/publish/
Deploy applications by using Source-to-Image Copy linkLink copied!
To deploy a .NET application from source, you can use the .NET SDK image with the Source-to-Image (S2I) toolkit in the OpenShift Client (oc).
Before you begin Copy linkLink copied!
- You have access to an OpenShift cluster.
- You have the OpenShift Client (
oc) installed and are logged in to the cluster. - You have the .NET 10.0 image streams installed on the cluster. See Installing .NET image streams.