In this article, we’ll look at using OpenAPI with .NET Core. OpenAPI is a specification for describing RESTful APIs. First, I’ll show you how to use OpenAPI to describe the APIs provided by an ASP.NET Core service. Then, we’ll use the API description to generate a strongly-typed client to use the web service with C#.
Writing OpenAPI descriptions
Developers use the OpenAPI specification to describe RESTful APIs. We can then use OpenAPI descriptions to generate a strongly-typed client library that is capable of accessing the APIs.
Note: Swagger is sometimes used synonymously with OpenAPI. It refers to a widely used toolset for working with the OpenAPI specification.
Continue reading “Using OpenAPI with .NET Core”
Well, it finally happened. Despite the added assurances of working with containers and Kubernetes, the old “It works on my machine” scenario reared its ugly head in my .NET Core (C#) code. The image that I created worked fine on my local PC—a Fedora 32 machine—but it crashed when I tried running it in my Red Hat OpenShift cluster.
The error was “Unable to obtain lock file access on /tmp/NuGetScratch.” Let’s take a quick look at what happened, and then I’ll explain how I fixed it.
After a lot of web searching and a discussion with a Red Hat .NET Core engineer, I discovered the underlying problem. It turns out that within a container, the identity used to initially run the program (using the
dotnet run command) must be the same for subsequent users.
The problem might be easy to understand, but what’s the solution?
Continue reading “How to fix .NET Core’s ‘Unable to obtain lock file access’ error on Red Hat OpenShift”
In this article, we’ll look at different ways of collecting and inspecting events from the .NET Core runtime and base class library (BCL).
EventListener class allows us to get events of the running application. Let’s learn how to use it with an example application. Our application performs an HTTP get and prints the length of the received response.
Continue reading “Tracing .NET Core applications”
In this article, we’ll look at .NET’s
Process class. We’ll go over the basics of how and when to use it, then cover differences in usage between Windows and Linux, and point out a few caveats. This article covers behavior in .NET Core 3.0.
Continue reading “The .NET Process class on Linux”
.NET Core 3.0 brings many exciting new features, including a new major release of C#, improved performance and support for building Windows desktop applications (on Windows). In this article, we’ll look at interesting new features for Linux and Linux container users.
Continue reading “New features in .NET Core 3.0 on Linux”
Many people have done continuous integration and continuous delivery (CI/CD) for .NET Core, but they still may wonder how to implement this process in Red Hat OpenShift Container Platform (OCP). The information is out there, but it has not been structurally documented. In this article, we’ll walk through the process.
Continue reading “CI/CD for .NET Core container applications on Red Hat OpenShift”