Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Systems Programming with C# and .NET
  • Table Of Contents Toc
Systems Programming with C# and .NET

Systems Programming with C# and .NET

By : Dennis Vroegop
5 (3)
close
close
Systems Programming with C# and .NET

Systems Programming with C# and .NET

5 (3)
By: Dennis Vroegop

Overview of this book

If you want to explore the vast potential of C# and .NET to build high-performance applications, then this book is for you. Written by a 17-time awardee of the Microsoft MVP award, this book delves into low-level programming with C# and .NET. The book starts by introducing fundamental concepts such as low-level APIs, memory management, and performance optimization. Each chapter imparts practical skills, guiding you through threads, file I/O, and network protocols. With a focus on real-world applications, you’ll learn how to secure systems, implement effective logging, and deploy applications seamlessly. The book particularly emphasizes debugging, profiling, and addressing challenges unique to multithreaded and asynchronous code. You’ll also gain insights into cybersecurity essentials to help you safeguard data and establish secure communications. Moreover, a dedicated chapter on systems programming in Linux will help you broaden your horizons and explore cross-platform development. For those venturing into embedded systems, the final chapter offers hands-on guidance. By the end of this book, you’ll be ready to deploy, distribute, and maintain applications in production systems.
Table of Contents (18 chapters)
close
close

Setting up your development environment

I asked you to follow along. I requested that you open up your development environment and do what I do. However, to do that, you need to set up the right kind of development environment so that you can actually do what I do.

Let me help you with that.

I use Visual Studio 2022 Enterprise. There is no particular reason I use the Enterprise version besides having that on my machine. There are two other versions: The Professional and the free Community edition. All three versions are fine for the things we want to do. However, the Enterprise edition does have some debugging tools we might need when discussing debugging. When that time comes, I will pinpoint the differences and show you other ways of achieving your goals.

Alternatives such as JetBrains Rider and Visual Studio Code also work, but you might have to do more work yourself when we go into performance tuning and debugging. Again, I will tell you about these when we get there.

I have limited experience with Rider, so I cannot tell you precisely what you need to do, but I am sure that when you are an experienced developer, you can translate what I am showing you into the tools you know and love.

Use what you have and what you know. I am cool with that.

If you decide to go with Visual Studio, which I highly recommend, you should use version 2022 instead of 2019. The latest versions of .NET and C# offer a lot related to performance tuning and memory optimizations. Those versions are only available in the 2022 version of Visual Studio. So, make sure you have that one on your device.

Next to that, we will be doing a lot of console stuff. That means using PowerShell: gone are the days of using cmd.exe.

I highly recommend downloading Windows Terminal. With Terminal, you can have all sorts of consoles. We will use PowerShell most of the time, but when we talk about Linux, we will use the WSL feature to use our machines as Linux machines.

Downloading and installing Terminal is a breeze: you can find it on the Microsoft Store.

Make sure to install Windows Subsystem for Linux as well. Instructions on how to do that are all over the internet; I will not repeat that here.

Once you have installed all of your favorite tools, you can select any one of them in your Terminal. Mine looks like this:

Figure 0.6: Windows Terminal with different shells

Figure 0.6: Windows Terminal with different shells

As you can see, I have PowerShell, Command Prompt, Ubuntu, Azure Cloud Shell, and some more installed. Selecting one of them is a matter of clicking.

Switching between Linux and Windows has never been easier!

Another tool we will be using later on is WinDbg. WinDbg is an extremely powerful external debugger. It can give you a lot of information about the processes you are interested in. It runs standalone, so you do not have to attach Visual Studio to the process. There are versions available for both X86 and ARM, so it is usable on many devices. You can find WinDbg on the Microsoft website at https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/. Download and install that. WinDbg might become one of your latest best friends.

Next, you might want to install PerfView. It is a free and open-source performance monitoring tool from Microsoft, specially built for analyzing performance on .NET applications.

You can find the source code at https://github.com/Microsoft/perfview. You can download the sources and build the tool yourself or grab one of the pre-build versions. Those are also on that same site. I would suggest building yourself and looking through the source code: there are some terrific examples of how to build software like this. I do not intend to describe how the tool works internally, but I will use it when discussing performance.

Now, all you need is a cup of your favorite beverage, and we are good to go!

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Systems Programming with C# and .NET
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon