Browsing posts in: c#

dotnet-script 1.2 is out with assembly isolation feature

Last month we released version 1.2 of dotnet-script. This was already 36th release of the tool and I am proud to say all the dotnet-script releated packages on Nuget have passed 1 million downloads – thanks a lot!

The latest release (which already has a 1.2.1 patch too), contains several useful bug fixes, including a memory leak and one excellent new feature – assembly isolation.

Continue Reading


Eager refresh of values for AsyncExpiringLazy

Some time ago I blogged about introducing a new library, called AsyncExpiringLazy, which can be used for managing lazy-resolved values that expire and must be refreshed – such as for example access tokens to web APIs.

Yesterday I pushed out a release 2.1.0 of the library, which features a unique new feature – built thanks to the great work of Lukasz – some new additional semantics for the way how the captured value gets refreshed.

Continue Reading


dotnet-script 1.0.0 released – with support for .NET 5.0 and C# 9

To celebrate the release of .NET 5.0, which happened yesterday, we are happy to announce the release of dotnet-script – with support for .NET 5.0 and C# 9.

In addition to that, we have decided that after such a long time since we started this project off, and a rather stable public API, it is high time to celebrate this .NET 5.0 release by additionally moving dotnet-script to version 1.0.0.

Continue Reading


Beautiful and compact Web APIs with C# 9, .NET 5.0 and ASP.NET Core

Almost fours year ago I blogged about building lightweight microservices with ASP.NET Core 1.2 (which actually never shipped in such version and later became ASP.NET Core 2.0). The idea there was to drop the notion of bloated MVC controllers, get rid of as much as we can of the usual verbosity of C# based applications, and use a set of simple extension methods and a few cutting edge features of ASP.NET Core to provide a node.js style experience for authoring Web APIs.

The article and the accompanying demo projects received quite a lot of attention, and I even got a chance to speak at some conference about these type of approaches to building focused, small microservices. With the .NET 5.0 in sight (.NET 5.0 RC2 is out at the time of writing this), and some remarkable features of C# 9, this “lightweight Web APIs” concept deserves a revisit, and this is what we will do in this blog post.

Continue Reading






Using async disposable and async enumerable in frameworks older than .NET Core 3.0

One of the awesome features introduced in .NET Core 3.0 and C# 8.0 are async streams. The feature consists of two parts – async disposable, for async clean up, as well as async enumerable, for async iteration.

Normally, the C# language features are backwards compatible and can be used regardless of the runtime framework being targeted. In this particular case, however, the newly introduced types that are needed for async streams feature to work, such as for example IAsyncDisposable or IAsyncEnumerator<T>, were only added in .NET Core 3.0, restricting the usage of the features to that runtime, and later.

Let's have a look at how you can still benefit from async disposable and async enumerable on older frameworks.

Continue Reading



Pages:123...15»