Getting git version information in your C# code
How to embed Git version information like commit hash and tags directly into C# code using the GitInfo source generator library.
Steven Giesel is a Senior Software Engineer and Microsoft MVP with over 13 years of experience, specializing in .NET and modern backend development. He shares deep technical knowledge across topics such as C#, EF Core, RavenDB, distributed systems, and cloud-native architectures, and is an active speaker in the .NET community.
311 articles from this blog
How to embed Git version information like commit hash and tags directly into C# code using the GitInfo source generator library.
Explains the error NETSDK1194 in .NET builds, why it occurs with recent SDK updates, and how to address it.
Analyzes a performance quirk in C#'s JsonSerializer when creating new JsonSerializerOptions instances, showing significant memory and speed penalties.
Explains what middleware is in ASP.NET Core, its role in the request pipeline, and provides a practical implementation example.
A guide to implementing multi-tenancy in ASP.NET Core applications using RavenDB, covering architecture, advantages, and code examples.
A comprehensive mind map visualizing C# language features from version 1.0 through the upcoming C# 12, with clickable links to examples.
Explains the Repository design pattern in C#/.NET, covering its purpose, basic implementation, benefits, and potential drawbacks.
Entity Framework 8 adds native SQL Server support for .NET's DateOnly and TimeOnly types, eliminating the need for custom converters.
Explains C# 'lowering' - how high-level syntax like foreach and async is transformed into simpler constructs by the compiler.
Explains why deep code nesting is problematic and demonstrates refactoring techniques like extraction and inversion to reduce complexity in C#.
Explains the new C# 12 primary constructor feature, comparing it to records and detailing its syntax and usage.
Explains software cohesion as a metric for refactoring, with a C# example showing how to split a low-cohesion class.
Entity Framework 8 introduces raw SQL queries for unmapped types, reducing boilerplate code for developers.
A tutorial on implementing a simple, reusable pagination solution for Entity Framework using a PagedList class and extension method.
Explains the misconception that Tasks in C# are for multithreading, clarifying they represent asynchronous operations, not threads, and are not primarily for performance.
A guide on using GitHub repositories as a professional portfolio to impress employers and land tech jobs, focusing on project presentation and code quality.
Introduces a .NET tips and tricks website and a high-performance ValueStringBuilder project, showcasing low-allocation string building techniques.
Introducing .NET 7's StringSyntaxAttribute to add semantic meaning to string parameters, enabling better IDE support for regex, dates, and formats.
Explains the new C# 12 feature allowing default parameter values in lambda expressions, with examples and usage in Minimal APIs.
Explains the pitfalls of comparing ReadOnlySpan<char> objects in C#/.NET, highlighting differences from string comparison due to memory representation.