stream:// .net


.NET 6: Threading Improvements

While numerous libraries exist to abstract away the complexities of asynchronous and concurrent programming, developers still need to drop down to lower thread-handling logic from time to time. Continuing our API changes for .NET 6 series, we look at some new tricks for multi-threading.

Announcing ODP.NET 21.3 — User-Defined Types for Managed ODP.NET and ODP.NET Core

I’m excited to announce the second ODP.NET 21c release, version 21.3, is now available on NuGet Gallery for both managed ODP.NET and…

Synchronous vs Messaging: When to use which?

!Synchronous vs Messaging? RPC or Asynchronous? Which should you choose? It depends on where the request originates from!

How to Stop NullReferenceExceptions in .NET: Implementing Nullable Reference Types

This article gives you a toolset for stopping NullReferenceExceptions in .NET code. The article centers around Nullable Reference Types (NRT), a feature that Microsoft added in C# 8. This article mentions five additional tools to ensure that users will never encounter the exception and explains how to implement them in your code. The Toolset Use non-nullable variables (Reference and value types): flag variables that should never be nullNull object pattern: inject default implementations with null behavior instead of null referencesTreat NRT warnings as errors: enforce the NRT rules to ensure that variables cannot enter a null/not-null state at the wrong time. Treat NRT warnings as errors so code will not compile if it breaks the NRT rules.Immutability: reduce the risk of NullReferenceException by only setting the reference onceArgumentNullException: An oldy but a goody. Stop code execution early in cases where the consuming code does not treat NRT warnings as errors.Unit testing: pass nulls into your code to make sure the appropriate result occurs. Mutation testing can help you achieve a higher level of certainty in your tests. Note: This article talks about libraries and consumers of those libraries. This might sound like it's about open-source libraries, and it is, but it's also about maintaining libraries in your team. If you publish libraries, someone will be consuming them, and that might even be you. Nullable Reference Types I recommend reading the official NRT documentation before or after reading this post. This article will refer to some terminology in that documentation which is important to understand. Reference types (classes, delegates, interfaces) are nullable by their nature. So, why is there suddenly a feature in the language that makes it sound as though they are suddenly nullable? The answer is partly historical. Value types (primary data types and structs) are not inherently nullable. C# added the nullable values types feature and added a nullable ? shortcut in C# 7. The NRT feature follows on from this. It extends the concept so that types suffixed with ? are meant to allow null. The corollary of this is that when we turn NRT on (nullable aware context), types without the? flip from being inherently nullable to not nullable. The syntax also brings C# in line with several other modern languages like Dart. When turned on, variables are in nullable aware context. You can turn nullable aware context on project by project or file by file. You need to turn it on file by file in the older csproj formats (pre SDK style). For example, you cannot turn it on at the project level for UWP or Android. Variables declared where nullable aware context is off are considered nullable oblivious.  If you leave this feature half-implemented, it could be confusing for people consuming the library. The IDE quick info bubbles may not identify between nullable aware and nullable oblivious variables. The consumer may not know if they allow null or not, and it's not easy for them to tell the difference between these and variables that are nullable oblivious. You might choose to convert entire projects for this reason or not to implement NRT on older projects.  Note: NRT support in IDEs is getting better, and IDEs will likely distinguish between nullable aware and nullable oblivious variables in the quick info in the future. Turn on NRT (Nullable Aware Context) There are a few different strategies for turning on NRT. I recommend doing it all at once and at the project level if you can. As mentioned, doing it for half a library could confuse the consumer. This is the Microsoft documentation on upgrading to NRT. Open up the csproj file and add these lines: <LangVersion>Latest</LangVersion> <Nullable>enable</Nullable> You will see lots of warnings. The existing variables where the reference type does not have a ? suffix will become not nullable. This flips the meaning of the existing code. Any reference type variables that were nullable change to not nullable. If you want to turn on nullable aware context at the file level, add this to the top of the file. #nullable enable Note: you can also leave the language version at 8. Turn on Treat Warnings as Errors Warnings are not enough. You need to treat warnings as errors. Warnings are too easy to ignore, so you need to tell the compiler to stop compilation when you violate an NRT constraint. If you don't, you won't get the most s...

Thread by @davidfowl on Thread Reader App

Thread by @davidfowl: As usual, there are a boatload of new APIs coming in .NET 6. Most of these are driven by custom requests. Lets talk about some of them. #dotnet #aspnetcore In .NET 6, there's a...…

C# Highlights: Immutable Collections

In this short video, you’ll learn about Immutable collections from Leslie (https://twitter.com/lyrichardson01) and Brandon (https://twitter.com/TheCodeTravel...

Speed up your .NET and C++ development with Hot Reload in Visual Studio 2022

With the recent release of Visual Studio 2022 Preview 2 we’d like to use this blog post to dive deeper into the brand-new Hot Reload experience which works for both managed .NET and newly supported native C++ apps. With Hot Reload our goal is to save you as many app restarts between edits as possible,

Enums in C#: Hidden Pitfalls

C# has low barriers to entry and forgives a lot. Seriously, you may not understand how things work under the hood but still write code and remain easy-going about this. Though you still have to deal with different nuances over time. Today, we'll look at one o…

How to parse HTML in .NET | ScrapingAnt Blog

This article will show you how to parse HTML pages with C# and .NET. Learn the basic web scraping techniques to parse data with HtmlAgilityPack, AngleSharp, Fizzler, and CsQuery.

GitHub - microsoft/Microsoft.IO.RecyclableMemoryStream: A library to provide pooling for .NET MemoryStream objects to improve application performance.

A library to provide pooling for .NET MemoryStream objects to improve application performance. - GitHub - microsoft/Microsoft.IO.RecyclableMemoryStream: A library to provide pooling for .NET Memor...

Anatomy of a .NET app

What happens when you build a .NET app? What happens the instant you run it? The last time I studied this was when .NET Framework was in its...

ReSharper 2021.1.5 and Rider 2021.1.5 Released | The .NET Tools Blog

Hello everyone, As it happens, even bugfix updates sometimes require bugfix updates. Last week we released ReSharper 2021.1.4, which fixed a couple of issues in NRT analysis and source generator su

Modular Architecture in ASP.NET Core - Building Better Monoliths

In this article, we will discuss Modularizing Web Applications using Modular Architecture in ASP.NET Core. We will go through Monolith Architecture's various

Evolution of An Async LINQ operator

From deferred execution to cancellation and ConfigureAwait(false), an async LINQ operator has some tricky parts to get correctly.

Oracle Support for .NET 6 and Entity Framework Core 6: Statement of Direction

With the planned release of .NET 6 and Entity Framework Core 6 on November 9 this year, the Oracle .NET team wants to outline our plans to…

dotnet/csharplang

The official repo for the design of the C# programming language - dotnet/csharplang

Building Minimal APIs In .NET 6 - .NET Core Tutorials

Around 6-ish years ago, NodeJS really hit it’s peak in popularity. In part, it was because people had no choice but to learn Javascript because of the popularity of front end JS frameworks at the time, so why not learn a backend that uses Javascript too? But also I think it was because of the […]

Boost ASP.NET Core Performance with Static Content

Use a command-line tool to generate ASP.NET Core endpoints to static HTML files.

A Practical Guide to Higher Order Functions in C#

If you have been programming for any length of time, you may well have come across higher order functions, but (like me) may not have fully appreciated just how powerful they can be. If you've not heard of them before, never fear, I have an explanati...

SOCKS Proxy Support In .NET - .NET Core Tutorials

With anonymity becoming more and more important each day on the internet, people are turning to VPNs, gateways and proxies to encrypt and hide their identity on the internet. An extremely common protocol for doing this is known as SOCKS proxies. SOCKS proxies came out (Or atleast the protocol was defined) in the ’90s. But […]

What's new in Windows Forms in .NET 6.0 Preview 5

Read about the new features that are in Windows Forms in .NET 6.0 Preview 5.

Voordat je verdergaat naar YouTube

Voordat je verdergaat naar YouTubeInloggen een bedrijf van GoogleVoordat je verdergaat naar YouTubeGoogle gebruikt cookies en gegevens voor het volgende:Services leveren en onderhouden (zoals uitval bijhouden en beschermen tegen spam, fraude en misbruik).Betrokkenheid van doelgroepen en sitestatisti

Cost of exceptions

Throw exception only when something really unexpected happens. This advice should be taken seriously – here’s why.

Array iteration performance in C# — Branching and parallelization

This is a third post in a series on performance in C#.

High Performance UDP sockets in .NET 5

How our socket code in Enclave squeezes the maximum performance out of UDP in .NET

Hot Vacancies

.NETBack End Developer

Field Complete, .NET

Field Complete is a team of passionate, young & fun-loving professionals looking to change the uneffective way that Servicing Industry works on US markets. Field Complete is growing really fast. We are looking for a Back End Developer to build a top-level modern API, ready for high load. Strong expertise with:

Senior Xamarin Developer

DraftKings, Mobile

You will join a mobile team which is working on two very exciting projects, Sportsbook and Casino. The apps are used by users in the US, where we are working on the regulated markets. We are releasing apps every two weeks. Our apps are generating almost 75% of the company revenue and the user base is growing daily. Technical stack on the project: Xamarin.Forms, MVVM with DI, NewRelic, Azure + App Center etc. Switching to .Net MAUI in the nearest 2-3 months.

Senior .NET Engineer

DraftKings, .NET

You will be working in a large US-oriented company that puts as a priority: security, performance, and stability. The candidate will work on pushing a huge number of changes (several thousand per sec) to several thousand clients in a near real-time manner.

Middle strong .NET developer

SoftServe, .NET

Our customer is an American company that develops software for businesses to help manage their networks, systems, and information technology infrastructure. The company provides purpose-built products for IT professionals, MSPs, and DevOps pros.

Junior .NET Developer

Chudovo OU, .NET

We are looking for a Junior .Net developer for being involved in to further development of the B2B platform for IT companies. You'll work on mostly back-end tasks closely with a Senior level developer.