When using both Visual Studio and Visual Studio Preview, the dotnet CLI may unintentionally select the latest SDK, causing build failures. This article will show you how to fix this issue.
Tag: Tip of the Week
Using Async/Await with Disposable Objects
This article will show by example how to dispose of disposable objects when using the async/ await pattern.
Coding Faster with the dotNetTips Utility: StringBuilder Extensions
Recently, I was looking at the source code for Entity Framework Core and found a few interesting extension methods for the StringBuilder class. So I moved the ones I liked to my open-source project called dotNetTips.Utility.Standard.Extensions and is part of the NuGet package too. Appending Bytes If you want to combine an array of byte … Continue reading Coding Faster with the dotNetTips Utility: StringBuilder Extensions
ASP.NET Response Compression: Enhancing Application Performance
In the midst of one of my conference talks, I presented a pivotal question to the attendees: What stands as the primary performance bottleneck for modern-day apps? While diverse answers emerge, the resounding reply points to the internet itself. This assertion isn't merely theoretical; it's a reality I've personally witnessed and can attest to. In … Continue reading ASP.NET Response Compression: Enhancing Application Performance
Properly Comparing Strings with Globalization and Performance in .NET
In Microsoft .NET there are many ways to compare strings. I would say that most of the code I analyze, I see it done one of these two ways: bool result = email1 == email2; bool result = email1.Equals(email2); Is this the best way to compare strings? The quick answer is no. While this works, … Continue reading Properly Comparing Strings with Globalization and Performance in .NET
Performance: Exception Trapping
Last year while presenting my Rock Your Code: Code and App Performance in Microsoft .NET session at a conference, one of the attendees asked me if using the When() clause is faster or not when trapping Exceptions. I found the question intriguing, so I set out to do performance testing for his question. Two Ways … Continue reading Performance: Exception Trapping
Proper Type Encapsulation – Part 2
In part 1 of this article, I explained how to implement proper data encapsulation. In part 2 I want to talk about encapsulating business logic. I see this missing in a lot of type design, especially when using an ORM like Entity Framework. It’s the job of the architect and coder of that type to … Continue reading Proper Type Encapsulation – Part 2
Performance Tip: Checking For Empty String
In all my books and conference sessions I talk about the proper way to test if a string is valid. Microsoft .NET has been around almost two decades and I still see code like this: if (testValue.Trim() == "") This code is even wrong since it's not checking for null. A better way would be like this: … Continue reading Performance Tip: Checking For Empty String
Processing AWS SQS Messages via a LAMBDA
With the short time I have been programming using Amazon Web Services (AWS) I have learned three things... AWS is NOT .NET Framework friendly! They are more .NET Core friendly but don't keep up with the latest version. The AWS .NET SDK needs a lot of work. I've previously wrote about this in my "Is … Continue reading Processing AWS SQS Messages via a LAMBDA
Proper Type Encapsulation – Part 1
Encapsulation is the first pillar of Object-Oriented Programming and maybe the most important. This is how wikipedia.org defines encapsulation: Encapsulation is one of the fundamentals of OOP (object-oriented programming). It refers to the bundling of data with the methods that operate on that data. Encapsulation is used to hide the values or state of a … Continue reading Proper Type Encapsulation – Part 1

You must be logged in to post a comment.