NativeLibrary is a new class in .NET Core 3.0 for interacting with native libraries. In this article, we’ll take a closer look.
.NET makes it simple to call functions from a native library using
public static extern int foo();
This code makes available the function
foo from the native library
mylibrary. This function accepts no arguments and returns an
int. .NET takes care of marshaling the argument types. It is possible to use managed types (like strings), which will be automagically marshaled.
Continue reading “Interacting with native libraries in .NET Core 3.0”
In this article, we’ll take a look at
Tmds.ExecFunction, which is a library that allows developers to easily execute a .NET Core function in a separate process.
Continue reading Executing .NET Core functions in a separate process
In previous articles, I’ve covered two strategies for improving .NET Core build speed on Red Hat OpenShift by reducing time to restore dependencies: adding a local NuGet server and using incremental builds. In this article, I’ll look at another strategy: using a custom base image that has includes the dependencies.
Continue reading “Improving ASP.NET Core build speed on Red Hat OpenShift”
In a previous article, we talked about using containers to build .NET Core application images to make our builds portable and reproducible. Because each build starts from scratch, some time is spent downloading and extracting NuGet packages.
One way to reduce build times is to add a local NuGet server; this brings packages closer to the build machines, which reduces the time to download the packages. In this article, we’ll look at how the new incremental build feature of the .NET Core S2I builder can further reduce build times.
Continue reading “Reduce application image build times with .NET Core incremental builds”
If you’ve developed Windows applications with .NET, you may have found yourself in a situation where the framework did not provide the APIs you needed. When that happens, you first need to identify the system APIs and then make them available using PInvoke. A website like pinvoke.net provides copy-and-pasteable code snippets for many Win32 API functions.
.NET Platform Invoke (PInvoke) makes it easy to consume native libraries. In this article, we’ll take a look at using PInvoke for Linux system functions.
Continue reading “Using .NET PInvoke for Linux system functions”
NuGet is the .NET package manager. By default, the .NET Core SDK will use packages from the nuget.org website.
In this article, you’ll learn how to deploy a NuGet server on Red Hat OpenShift Container Platform (RHOCP). We’ll use it as a caching server and see that it speeds up our builds. Before we get to that, we’ll explore some general NuGet concepts and see why it makes sense to use a local NuGet server.
Continue reading “Using a local NuGet server with Red Hat OpenShift”
.NET Core 2.2 has been released. You can try it on Red Hat Enterprise Linux (RHEL) and OpenShift. One of the new features of ASP.NET Core is the Health Checks API.
In this article, which was written for C# Advent Calendar 2018, I show an example of how the API works with OpenShift by implementing two health checks for the Kubernetes liveness and readiness probes. Since OpenShift includes Kubernetes, this example also works well with Kubernetes.
Continue reading “Using Kubernetes readiness and liveness probes for health checks with ASP.NET Core 2.2 on OpenShift”
Red Hat OpenShift implements .NET Core support via a source-to-image (S2I) builder. In this article, we’ll take a closer look at how you can use that builder directly. Using S2I, you can build .NET Core application images without having to write custom build scripts or Dockerfiles. This can be useful on your development machine or as part of a CI/CD pipeline.
Continue reading “Building .NET Core container images using S2I”
We are very excited to announce the general availability of .NET Core 2.2 for Red Hat Enterprise Linux and OpenShift platforms! This general availability is in lock-step with Microsoft’s release yesterday.
.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.2 continues to broaden its support and tools for application development in an open source environment. The latest version of .NET Core includes the following improvements:
Continue reading “Announcing .NET Core 2.2 for Red Hat Platforms”
.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”