.NET has APIs for locating special folders that can be used for application and user configuration and data storage. They provide a convenient, portable way to make cross-platform applications find the appropriate folders on different operating systems. We’ll look at how
Path.GetTempFileName behave on Linux.
Continue reading “Locating special folders in cross-platform .NET applications”
In this blog post, we’ll set up Microsoft SQL Server on Red Hat OpenShift. We’ll use SQL Server to store data for a simple ASP.NET Core application running in a container deployed on OpenShift that manages a list of contacts. When we have that set up, we’ll use SQL Operation Studio to connect to the server running on OpenShift from our developer machine.
Continue reading “Running Microsoft SQL Server on Red Hat OpenShift”
ASP.NET Core is the web framework for .NET Core. Performance is a key feature. The stack is heavily optimized and continuously benchmarked. Kestrel is the name of the HTTP server. In this blog post, we’ll replace Kestrel’s networking layer with a Linux-specific implementation and benchmark it against the default out-of-the-box implementations. The TechEmpower web framework benchmarks are used to compare the network layer performance.
Continue reading “Improving .NET Core Kestrel performance using a Linux-specific transport”
When you want to do automated tasks for builds and deployments with Red Hat OpenShift, you might want to take advantage of the OpenShift REST API. In scripts you can use
oc CLI command which talks to the REST APIs. However there are times when it is more convenient to do this directly from your C# code without having to invoke an external program. This is the value of having an infrastructure platform that is exposed as services with an open API.
If you want to call the API from your C# code, you have to create a request object, call the API, and parse the response object. The upstream project, OpenShift Origin, provides a Swagger 2.0 specification and you can generate a client library for each programming language. Of course, C# is supported. This isn’t a new approach, Kubernetes has a repository that is generated by Swagger Codegen.
For C#, we can use Microsoft Visual Studio to generate a C# client library for a REST API. In this article, I’ll walk you through the process of generating the library from the definition.
Continue reading “How to call the OpenShift REST API from C#”
Containers are the new way of deploying applications. They provide an efficient mechanism to deploy self-contained applications in a portable way across clouds and OS distributions. In this blog post we’ll look at what OpenShift brings for .NET Core specifically.
Kubernetes and OpenShift
Kubernetes is the de facto orchestrator for managing containerized applications. Google open-sourced Kubernetes in 2014 and Red Hat was one of the first companies to work with Google on Kubernetes. Red Hat is the 2nd leading contributor to the Kubernetes upstream project.
OpenShift is an open-source DevOps platform that is built on top of Kubernetes. It integrates directly with your application’s source code. This enables continuous integration/continuous deployment (CI/CD) workflows. Tools are available to scale and monitor your applications. The OpenShift Catalog makes it easy to setup middleware and databases. OpenShift comes with comprehensive documentation to install and manage your installation. It can run on-prem and on public clouds such as AWS, GCP and Azure.
Continue reading “Using OpenShift to deploy .NET Core applications”
We are very pleased to announce the general availability of .NET Core 2.1 for Red Hat Enterprise Linux and OpenShift platforms!
.NET Core is the open-source, cross-platform .NET platform for building microservices. .NET Core is designed to provide the best performance at scale for applications that use microservices and containers. Libraries can be shared with other .NET platforms, such as .NET Framework (Windows) and Xamarin (mobile applications). With .NET Core you have the flexibility of building and deploying applications on Red Hat Enterprise Linux or in containers. Your container-based applications and microservices can easily be deployed to your choice of public or private clouds using Red Hat OpenShift. All of the features of OpenShift and Kubernetes for cloud deployments are available to you.
.NET Core 2.1 continues to broaden its support and tools for microservice development in an open source environment. The latest version of .NET Core includes the following improvements:
Continue reading “Announcing .NET Core 2.1 for Red Hat Platforms”
Last year, I wrote a blog post how to remotely debug your ASP.NET Core container on OpenShift with Visual Studio Code. Today I introduce how to remotely debug a pod using Visual Studio from your Windows computer. Sometimes you encounter an issue that happens only in the production environment. Remotely debugging a pod enables you to investigate such an issue.
Visual Studio and Visual Studio Code now support SSH as a transport protocol for remote debugging. If a remote host accepts an SSH connection, Visual Studio can do remote debugging using Visual Studio’s default feature. However, you need to use the
oc command instead of an SSH client such as putty since Red Hat OpenShift pods don’t allow direct connections via SSH. The MIEngine debugger enables you to use any command for SSH connection.
All the steps below have been confirmed using a combination of Visual Studio 2017 (versions 15.7.2 and 15.8 preview2) on Windows 10 and OpenShift 3.9.
Continue reading “Remotely Debug an ASP.NET Core Container Pod on OpenShift with Visual Studio”
At Red Hat Summit 2018, Red Hat’s John Osborne and Microsoft’s Harold Wong gave a talk: Developing .NET Core Applications on Red Hat OpenShift.
.NET Core 1.0 availability for Linux was announced two years ago, but many developers still have a number of questions about the differences between .NET Framework and .NET Core. The session started with an overview of the differences. In a nutshell, .NET Framework is the set of APIs and libraries that Windows developers have used to years, which is pretty heavily tied to Microsoft Windows and Windows GUI APIs. On the other hand, .NET Core is the cross-platform set of APIs that are available for building applications that can run on Linux, macOS, or mobile devices via Xamarin. .Net Core 2.0 was released last August; see Don Schenck’s article.
One of the key questions is when to use one versus the other. Here’s the summary Harold Wong presented:
Continue reading “Red Hat Summit: Developing .NET Core Apps on Red Hat OpenShift”
I’ve started an interesting exploration on the integration of Microsoft Windows Containers and Linux Containers in an OCP Environment. This allows a true bi-modal IT technical implementation by combining the strength of both platforms into one cluster.
Continue reading “First steps in integration of Windows and Linux Containers in OpenShift”
Most books teaching C# start with a ‘Hello World’ application. This simple program is used to explain concepts like namespaces, classes, Main and Console.WriteLine. When every line of the code has been dissected, it’s clear how it works.
It’s less obvious for an ASP.NET Core application. We are no longer invoking our code; instead, the ASP.NET Core framework is doing that for us. In this blog post, we’ll look at a simple ASP.NET Core application and explain how ASP.NET Core makes it tick.
Continue reading “ASP.NET Core Hello World Explained”