.NET Tools
Essential productivity kit for .NET and game developers
.NET Annotated Monthly | August 2023
Did you know? Observability is tagged as #o11y across social media platforms. Where did that hashtag come from? It’s a numeronym, in which we repeat the first and last letter of the original word, and the number in the middle represents the amount of characters that are omitted.
.NET news
- Announcing .NET 8 Preview 6
- New C# 12 preview features
- ASP.NET Core updates in .NET 8 Preview 6
- Announcing .NET MAUI in .NET 8 Preview 6: Hello VS Code & VS for Mac
- Improved Source Generators and Code Fixers Arrive in .NET Community Toolkit 8.2.1!
- Welcome to the New Era of App Development: Introducing Avalonia v11
Featured content
We’d like to thank Laila Bougria for curating this month’s featured content! She is an international speaker, and a Microsoft Azure MVP. Laila enjoys the creative process of writing software and solving complex problems. In her free time, she loves to tangle up some yarn into beautifully knitted patterns as she untangles her thoughts. Catch up with Laila on Twitter and Mastodon.
Thanks for having me as a guest on the blog JetBrains! It’s a pleasure to share a little about my interests with a community that focuses on improving the experience of building software! A topic I’ve been very interested in lately is observability.
Why, you might ask? Over the last eight years or so, I’ve been focused on message- and event-driven systems, both in terms of building them and helping to build tooling to support these kinds of systems. When I first started building systems using messaging, it required a true mind-shift: from understanding asynchronicity and dealing with eventual consistency to achieving idempotency. Nevertheless, I quickly realized how much this architectural style helped me model applications in a way that made them easier to maintain and more aligned with the business domain than ever before. However, there was one significant drawback to this type of system: it was incredibly hard and complex to debug.
That’s why observability caught my eye, specifically with the introduction of the OpenTelemetry project in 2020. Observability refers to the ability to understand the inner workings of a running system based on the telemetry it emits. When we talk about observability in software, we’re not just talking about collecting data for the sake of it. Observability means having the ability to ask any question about your system’s behavior, performance, and health without changing any code (which requires redeployment, too!), hours of yak shaving, assembling log files from different servers, and without late pizza evenings writing complex database queries and speculating about how the data got there. Most importantly, it means not disappointing users by telling them they must have imagined the perceived behavior because it works on our machine.
As the industry shifted to building more complex distributed systems with the rise of microservices and the breadth of available services and hosting options from cloud vendors, observability tools emerged. Although powerful, each solution presented its own programming model, guidelines, and storage format. With the OpenTelemetry project, the Cloud Native Computing Foundation built a vendor-, language- and platform-agnostic solution for observability that finally standardizes how applications generate, collect, and export telemetry information to observability backends. With support for tracing, metrics, and logs, it provides a wide range of signals that allow developers to increase the observability of complex systems.
The bottom line is that observability is not the next buzzword—it’s a must-have in today’s complex software landscape. As our software continues to evolve and grow in complexity, we also need to invest efforts into simplifying and streamlining how we can understand their behavior. We can ensure just that by investing time and effort into observability and harnessing the power of OpenTelemetry.
If you’re ready to shed some light on the blind spots in your systems, I leave you with some additional resources on the topic to get you started:
- Message processing failed, but what’s the root cause? – I had the pleasure of presenting a session on this topic at the JetBrains .NET Days last year. This more recent recording from NDC Oslo, shows up-to-date samples with the latest .NET OpenTelemetry libraries.
- Announcing Azure Monitor OpenTelemetry Distro – In this recent announcement, Matt McCleary and Sam Spencer share Microsoft’s plans to adapt Azure Monitor and all Azure SDKs to use the OpenTelemetry Protocol (OTLP), making it language-agnostic.
- OpenTelemetry with the Grafana stack – If you’re looking for practical code examples on setting up OpenTelemetry in .NET using Grafana, Glen Versweyveld has covered you with his GitHub repository.
- OpenTelemetry .NET API on GitHub – The official .NET implementation for OpenTelemetry is open source, available on GitHub, and comes with comprehensive documentation and samples.
- O11y newsletter: Finally, if you want to remain up-to-date on the latest advancements in the observability space, Michael Hausenblas has a newsletter dedicated to the topic through which he shares his weekly findings.
Programing tutorials and tips
.NET tutorials and tips
- Exploring the .NET 8 Preview series – If reading the .NET 8 Preview announcement is not enough, and you’re off on summer adventures, Andrew Lock has got you covered with a blog series in which he covers the new configuration binder source generator, the minimal API AOT compilation template, evaluates the new CreateSlimBuilder method in support of AOT scenarios, and explores the new minimal API source generator.
- Exploring Blazor Changes in .NET 8: Server-side rendering – Jon Hilton explores the evolutions in Blazor with the new server-side rendering approach.
- TimeProvider and ITimer: Writing Unit Tests with Time in .NET 8 – Ready to finally address that flaky test that only seems to fail on a particular day in February during leap years? Artur Ampilogov discusses the challenges of handling time in tests and how the recent additions in .NET 8 Preview 4 can help.
- Learn Resharper PostFix and Source Templates – Those who have repetitive coding tasks could benefit from creating and using PostFixes and Source Templates, as shown here by Karen Payne.
- C# records, the with keyword, and reference types – In this post, Khalid Abuhakmeh discusses C# records gotchas and shares tips on how to use them effectively.
- Unit Test Frameworks for C#: The pros and cons of the top 3 – In this post, Erik Dietrick discusses the top 3 unit testing frameworks in the C# space: MSTest, NUnit and xUnit.NET.
- Improvements to the caching abstraction in ASP.NET Core – In this post, Catherine Wang and Marc Gravell share a concept of the improvements they plan to make to the caching abstraction. This is your opportunity to try it out early and share your feedback!
- Adding a Readme to Nuget Package landing pages – Khalid Abuhakmeh discusses the value of a Readme file and how to add it to your package’s NuGet landing page.
- Entity Framework features I wish I knew earlier – How often have you encountered a previously unknown feature in a framework and thought to yourself: if only I had known this before! In this post, Tim Deschryver shares exactly those findings for Entity Framework.
- Performance tricks I learned from contributing to open source .NET packages – If you want to learn how to optimize your code performance-wise, Daniel Marbach presents a comprehensive set of practices to apply to your code. On his GitHub repo, he shares additional reading material and interesting pull requests that showcase these tips!
- Debug source generators in JetBrains Rider – Source generators provide a power alternative to all that reflection code that’s made us feel ‘Yikes!’ over the years. However, debugging them is not for the faint of heart. Khalid Abuhakmeh shows you how to do so using JetBrains Rider.
- Etags in ASP.NET Core – If you want to learn what ETags are, why you should use them, and understand how to implement them based on your needs, then this post by Peter Ritchie is for you!
- Improve the security of your GraphQL APIs – Bart Wullems talks about GraphQL’s introspection system in this latest post of his GraphQL security series.
- Creating a VS Code editor extension -. In this post, Tim Heuer shows you how to leverage VS Code’s extensibility model to build a ResX-based custom editor.
- Compare Byte Arrays in .NET – There are many techniques in which we can compare byte arrays. In this post from CodeMaze, various techniques are discussed and benchmarked to compare their efficiency.
- Modernizing Rx.NET – The Reactive Extensions is a library that’s been adopted by many languages in the programming world. In this On .NET Live episode, Ian Griffiths discusses the project’s latest developments.
- Debugging .NET containers with Visual Studio Code Docker Tools – The Docker tools for Visual Studio Code 1.26.0 version includes a new launch method: Debug in Container. Chet Husk explains how this option allows you to seamlessly build your application into a container and launch it automatically with the debugging tools attached.
- Gracefully handling Entity Framework Exceptions with EntityFramework.Exceptions – Steven Giesel discusses how EntityFramework.Exceptions allow you to add more meaning and context to EntityFramework Exceptions.
- Automating End-to-End testing with Playwright and Azure Pipelines – In this post, Anusha Ammaluru will walk you through Playwright’s features and explains how to incorporate your end-to-end testing strategy into your Azure Pipeline.
- Microsoft .NET Code Analysis: Do not expose Generic Lists – List<T> is super easy to use, so it’s tempting to use it everywhere. David McCarter discusses why you shouldn’t expose List<T> to upstream code, but also the cases in which it makes sense to deviate from that general rule.
- Sample showing how to setup ASP.NET Core Identity API endpoints for authentication – Jeremy Likness talked about the improvements to auth and identity in ASP.NET Core 8. In this GitHub repo, David Fowler demonstrates how to set up the Identity API endpoints.
- Trace Propagation and Public API Endpoints in .NET – Part 1 – Martin Thwaites discusses trace propagation in .NET. It’s the first part of a series, so you’ll need to stay tuned for more!
Looking for awesome and helpful .NET libraries? Maarten’s got you covered.
Related programming tutorials and tips:
- Demonstrating end-to-end traceability with pull requests – Have you ever stumbled upon a PR, unable to understand what led to that change? Or maybe you had to figure out the changes that went into a release following a bug? In this post, Philip Holleran shares how to achieve end-to-end traceability with GitHub pull requests.
- What is a message queue and when and why would I use it? – In this session, Clemens Vasters takes you through the basics of messaging by explaining what a queue is, what problems it helps address, and discusses its basic features.
- What are HTTP headers? – We communicate over HTTP all the time, and that communication contains quite a few interesting things. If you’ve ever wondered about those headers, this is a good read from The Postman team.
- How to cancel GitHub workflows when pushing new commits on a branch – In this post, Gérald Barré explains how to leverage GitHub’s concurrency feature to automatically cancel in-progress runs when new workflows are triggered.
- GitHub merge queue is generally available – It can be incredibly frustrating to resolve all comments on a PR, only to realize that you have to handle a bunch of conflicts because a colleague beat you to it. If that sounds familiar, this post by Dustin Yin is for you.
- Vertical slices in practice – In this post, Oskar Dudycz discusses a practical example of applying the vertical slicing approach to your system architecture.
- The best (and worst) reasons to adopt OpenTelemetry – As with any framework, architectural style or architecture, we should adopt it for the right reasons. In this post, Daniel Khan shares valid reasons to adopt OpenTelemetry, but also invalid ones.
- Using your database as a queue? – In this post, Derek Comartin discusses the trade-offs to consider if you’re thinking about using a database as a queue to simplify your infrastructure requirements.
- Biggest scam in software dev? Best practices. – Following a recent tweet by David Fowler, Derek Comartin discusses why best practices shouldn’t be treated as rules, but we should instead consider the context and tradeoffs of each practice.
- Enhancing your “Definition of Done” can improve your minimum viable architecture – I’m done with this issue! But what does done really mean? In this article, Pierre Pureur and Kurt Bittner discuss how having a clear definition of what “done” means can help improve the sustainability of your system.
- Microservices vs monoliths – The microservice architecture style has been all the rage. But is a monolith really that bad? And how do you choose which one to build? Here are a few resources around the topic to read/watch through:
- How to decide between microservices and a monolith – In this post, Yves Goeleven discusses how to decide between the two.
- Building that glorious monolith. And carving it too. – In this session presented at NDC Oslo, Glenn Henriksen discusses their approach on a recent project.
- Stick to boring architecture for as long as possible – Addy Osmani discusses this topic from the point of view of focusing on delivering value to stakeholders.
- Cleaning your Big Ball of Mud using CQS – In this recent Unhandled Exception podcast, Dan Clarke talked to Matt Hunt on how to break down those big balls of mud, in this case, using Command-Query Separation. Oh, and apart from running his podcast, Dan just started his own newsletter recently too!
Check out this great Azure Blob Storage Bindings tweet tutorial by Golda.
Interesting and cool stuff
- Announcing the first Machine Unlearning challenge – AI has been all the rage lately, and recent tools show the impact it could have on our everyday lives. However, the potential risks can’t be ignored either. In this post, Fabian Pedregosa and Eleni Triantafillou discuss the first-ever machine unlearning challenge.
- Working backwards: The story behind the AWS Cloud Development Kit – In this post, Elad Ben-Israel and Ricardo Sueiras show how Amazon’s Working backward method led to the success of the AWS Cloud Development Kit.
- C# Source Generators – On this GitHub repository, Amadeusz Sadowski not only maintains a list C# Source Generators but also assembles documentation, articles, videos and tips and tricks as well.
- Service Delivery Index: A Driver for Reliability – In this post, Matthew McKeen and Ryan Katkov discuss Slack’s Service Delivery Index, a composite metric for service reliability. Read through how this metric became one of their most important metrics around resilience, from its early conceptual ideas to full adoption, including the ups and downs and lessons learned.
- Microsoft responsible AI practices: Lead the way in shaping development and impact – Natalie Mickey talks about the responsible AI practices Microsoft focuses on and includes resources we can use to educate ourselves to apply them when using AI-powered services. Michelle Sandford also presented a session on the topic at NDC Oslo last year.
And finally, the latest from JetBrains
Here’s a chance to catch up on JetBrains news that you might have missed:
- Rider 2023.2: Better C# Support, UX/UI Enhancements, AI-Powered Features, and More
- ReSharper 2023.2: More C#, C++ 20, And C++ 23 Features, the Ability To Create And Navigate Through Unit Tests, Predictive Debugger Mode, And More
- dotCover, dotMemory, dotPeek, and dotTrace 2023.2 Released!
⚒️ Check out our .NET Guide! Videos, tips, and tricks on .NET related topics. 🎥🪄⚒️
Blog posts, webinars, etc..:
- dotTrace comes to BenchmarkDotNet
- Debug Source Generators in JetBrains Rider
- EditorConfig, Code Style, and configured code inspections
- Introducing Predictive Debugging: A Game-Changing Look into the Future
- Reverse Engineering Existing Databases with Entity Framework Core
- EditorConfig, Code Style, and Configuring Code Inspections
- OSS Power-Ups: AngleSharp – Webinar Recording
- Joshua Jesper Krægpøth Ryder – The Future Is Here! WebAssembly for .NET Developers – Recording Available
- Accelerating Your Testing Workflow with Unit Test Creation and Navigation
Don’t miss this fantastic offer! CODE Magazine is offering a free subscription to JetBrains customers. Get your copy today!
Sharing is caring! So share content that you find useful with other readers. Don’t keep it to yourself! Send us an email with your suggestions for publication in future newsletters!