.NET Annotated Monthly | May 2023
Did you know? There is a difference between compilation and transpilation. The short explanation is that compilers use code from one language to produce output, usually binary. Transpilers are a type of compiler that produce source code but at the same level of abstraction, so the output is usually more source code.
- Announcing .NET 8 Preview 3
- ASP.NET Core updates in .NET 8 Preview 3
- Announcing .NET MAUI in .NET 8 Preview 3
- Check out new C# 12 preview features!
- Join the .NET Team at Microsoft Build 2023!
- Announcing .NET Community Toolkit 8.2! Faster generators, code fixers, performance improvements and more!
- .NET April 2023 Updates – .NET 7.0.5, .NET 6.0.16
- Let’s Learn .NET Virtual Events – All Around the World
- New MAUI Popup control and WinUI Avatar from Syncfusion
We’d like to thank Laurent Kempé for curating this month’s featured content! Laurent is a JetBrains .NET Community Contributor and Microsoft MVP for Developer Technologies. He is passionate about new technology, teamwork, and developer productivity. He publishes content on his blog, twit as laurentkempe, shares open source code on GitHub, and publish his photos on flickr.
Thank you, JetBrains, for having me as a curator of your .NET Annotated for May 2023. As a long-time supporter of your developer tools, I appreciate it.
I started with computers when I was 12 on a ZX81. It had 1 KB of memory. I later extended it to 16KB. At that time, the memory was precious for programmers. We would optimize any bits.
Today, my desktop has 64GB, my notebook 32GB, and my phone 8GB, crazy! Nevertheless, I still feel that the memory is precious. Some technology movements, such as serverless and edge computing, amplify that feeling.
The container’s size is another area where the memory footprint is essential. The smaller the container size, the faster it gets deployed, the more you can deploy on one physical machine, and the less it costs to run.
As .NET C# developers, we got reminded about the importance of memory footprint for quite some time with Blazor WebAssembly. Running .NET code in the browser means downloading the .NET Common Language Runtime (CLR) to the web browser. With .NET 7, the size of the CLR downloaded with the file ‘dotnet.wasm’ is around 2.5MB, which is already quite impressive. Then there are all the .NET framework assemblies for another 20MB. Of course, there are techniques like caching that reduce the impact. There is also trimming and AOT. On top of that, the .NET team is working on lowering that size even more for .NET 8.
WASM (WebAssembly) is a good topic when you talk about reducing the size of payloads. WASI (WebAssembly System Interface) is another one. WASI is a system interface for WebAssembly. It is a way to run WebAssembly outside of the browser. It lets you run WebAssembly on a server, on the edge, on the desktop, on mobile devices, and IoT devices. So again, the memory footprint is essential.
I am delighted that Microsoft is embracing WASI, now available in the nightly build of the .NET SDK for .NET 8. I love seeing Fermyon letting us “Experience the next wave of cloud computing” with .NET! Then we have the idea of components, introduced by Dapr, for building portable and reliable microservices. Now, combine all of those things. We will have some new Lego pieces in our developer’s hands. Those will allow us to build impressive new applications and systems at a fraction of today’s cost.
I am looking forward to seeing where our industry is moving next. My passion is still huge for someone who started with computers in the 1980s. And by the way, I did not even speak about AI!
DotNetIsolator: an experimental package for running .NET code in an isolated sandbox – Steve Sanderson, the father of Blazor, shows us how to run .NET code in an isolated sandbox levergaging WASM/WASI. This is a great way to run untrusted code in a safe way. Stay tuned for more, soon.
Using WebAssembly to run, extend, and secure your .NET application – Niels Tanis gives an excellent presentation at NDC Security 2023, introducing WASM and WASI and then how to extending and secure .NET with WebAssembly.
.NET WASI support tracking – This issue is to track known issues in the early WASI-enabled runtime builds.
.NET runtime builds.
Fermyon Spin SDK for .NET Preview – Fermyon is a company that is building a new cloud platform based on WASM/WASI. They have a preview of their SDK available for .NET on GitHub.
WASM I/O 2023 – A great playlist of videos from the WASM I/O 2023 conference which happenend in March 2023.
Introduction to Dapr – Join Aaron Crawfis and Paul Yuknewicz to learn about Dapr, the Distributed Application Runtime. Learn how to install, init, and run Dapr in just a few seconds, and begin adding Dapr’s building blocks to your own applications. Also see what’s new in Dapr v1.10, including Dapr workflows.
Programing tutorials and tips
.NET tutorials and tips
- Animating color properties using .NET MAUI Community Toolkit – Create fun and great-looking color properties with .NET MAUI. Post by Leomaris Reyes.
- Deploy MAUI apps with Rider on your iOS device after these Xcode errors – If you’ve been experiencing errors when trying to deploy MAUI apps to iOS, then check out this article by MSiccDev showing how they solved the issue using Rider.
- Using Reactive UI in your .NET MAUI app – Reactive UI is a nice MVVM framework and in this tutorial Mark Allibone shows us how to use it in MAUI.
- The Ultimate .NET Version Guide and 17 Amazing Community Packages for .NET Developers – Here’s some great guides to the .NET landscape: versioning and awesome packages to use. Info by Claudio Bernasconi.
- How to Run an Async Method Synchronously in .NET – Sometimes you just want to see how the code works synchronously. Code Maze shows you how to do that.
- Setting Up RabbitMQ with Docker and Creating Web and Desktop Applications – There’s a lot of info succinctly packed into this post that provides an overview of how to get up and going with containerized RabbitMQ for either web or desktop by Shady Nagy. This is a setup that works for many types of applications.
- How to End-to-End Test SMS Applications with C# .NET and Twilio – This is an excellent piece by Niels Swimberghe covering all the details about testing C# code in apps that use Twilio’s SMS service.
- Exploring ASP.NET Core C# 7 Razor View vs. Blazor View in Existing Razor Project – Since Blazor is built on ASP.NET and Razor pages, what actually is the difference other than a little different syntax? David Robertson answers.
- How to secure legacy ASP.NET MVC against Cross-Site (CSRF) Attacks – It’s time to review some code as it relates to security in those legacy apps. Start with this tutorial by Aneesh Lal Gopalakrishnan.
- Setting an Absolute Output Path for .NET SDK Projects – This is one of those posts by Rick Strahl that scream “bookmark for when you need it because you will at one point”. So in the future when you need an absolute path for your .NET SDK projects, here you go.
- Easy Sorting, Filtering and Pagination in .NET With Sieve Package – Sieve (aptly named and nice looking tool) is a package for filtering datasets. So Phil Broderick penned this piece with all the data manipulation classics: sorting, filtering, and pagination but using Sieve.
- 5 useful extensions for Task<T> in .NET – Handy. Another nice one to bookmark to try these out when an appropriate coding scenario happens. Post by Steven Giesel.
- Web API Updates with .NET 8 – What’s going on in the latest .NET bits? Christian Nagel answers and opines.
- How do I use SQL Server with C# and .NET? – We’re back to basics in this video by Jiachen Jiang at Microsoft demonstrating how to connect to and use SQL with C# for CRUD and other operations.
- Creating an ASP.NET Minimal Web API to Generate PDF Documents from HTML Template Dynamically – This is really handy as it’s an example of a common business problem in many industries. Generating PDF documents, and in this case setting it up with an HTML template. Examples like this by Sowmiya Loganathan help us create our own robust forms.
- How to Get Started with Telerik Blazor Data Grid – Telerik’s grids are used by so many companies and here’s a nice tutorial for those new users out there by Jon Hilton.
- Normalize and compare URLs with C# – This is a really great short post by Thomas Ardal showing how to get our URLs straightened out.
- C# Tip: Access items from the end of the array using the ^ operator – Here’s a quick tip by David Bellone on accessing array items.
- Role-Based Access Control in Blazor Applications – Andrea Chiarelli published this tutorial on security in Blazor. For most enterprise apps, role-based access is recommended over other access types.
- Static fields are evil, if not coded correctly – David McCarter discusses how developers use and abuse static fields. Take a peek – one of my tweets ended up in here. It’s the one where I was remembering a coworker who just didn’t get static fields.
- Investigating a crash in Enumerable.LastOrDefault with a custom collection – Read on for some nice detective work by Gérald Barré in figuring out why `LastOrDefault` would crash like that.
#csharp #dotnet #EFCore #Database 💡— Daniel Lawson 🇹🇬🇧🇫🇲🇫 (@danylaws) April 11, 2023
Sometimes, you need to manage entities in your code that are not really standalone (no identity) from a database perspective. In Entity Framework Core, you can use Owned Entity Types to achieve that use case. What is it? A thread 🧵⬇️😊
Related programming tutorials and tips:
- Super-charging ‘git rebase’ with ‘git absorb’ – This is an interesting `git tidbit` of a post by Andrew Lock. There is a plugin called `git absorb` and you can use it when you’re rebasing to automatically create `fixup!` commits.
- Selecting the Best Authorization for Your API Integrations – If you have to integrate any two (or more) pieces of software, then you know the chaos that can happen with trying to integrate authorization. So hopefully this post by Alisa Duncan will help you out a bit for next time you have that big integration project.
- Remote Development with JetBrains Rider – Here’s a quick article on doing remote development by Robert Krzaczyńsk. Featuring Rider!
- An introduction to Windows Subsystem for Linux – Hey friends who use Windows, have you considered anything Linuxish at all, ever? How about trying out a little bit of Linux with Louëlla Creemers on WSL.
- 6 signals that your architecture is not visible enough – Dennis Doomen opines on the availability and discoverability of technical information about the software’s architecture in your company.
Interesting and cool stuff
- This is What it Feels Like to be Bullied Out of a Job You Love – Thank you, Wesley Faulkner, for taking the time and having the courage to write about a negative experience in order to make the working world a better place.
- Open Source Society University Computer Science Course – This has been out a while but it’s a great resource for anyone by OSSU.
And finally, the latest from JetBrains
⚒️ Check out our .NET Guide! Videos, tips, and tricks on .NET related topics. ⚒️
- Try RiderFlow and Share Your Experience With Us
- Game Development Tooling Tutorials – Unity, Unreal Engine, Rider, and RiderFlow
- ReSharper and Rider 2023.1.1 – Bug Fixes Are Here
- HTML, XML, JSON, and JWT Visualizers in Rider 2023.1
- Introduction to ASP.NET Core Minimal APIs
- How to Use Aqua Web Inspector for ASP.NET Core Development in Rider
- Reduce Collection Lookups With ReSharper
- Webinar – Stefan Pölz – How to test C# unit tests with mutation testing
- Object-Oriented vs. Functional Programming With C# and F# – Recording Available
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!
Subscribe to Blog updates
How To Use AI Assistant to Generate Test Data For .NET Applications
How To Use AI Assistant to Generate Test Data For .NET Applications for better unit tests.
Rider 2024.1 EAP 5: Collections Visualizer, Sticky Lines, Improved GitHub Actions Support, and More
We are mid-way through the Early Access Program for Rider 2024, which means the EAP 5 build has just been released, bringing a host of amazing updates. But before you go to download it, let’s go over the new features this preview contains. Collections visualizer Rider 2024.1 introduces t…