Follow us on X (Twitter)  Like us on Facebook  Connect with us on LinkedIn  Subscribe to our YouTube Channel  Subscribe to our WhatsApp Group

C#

Showing posts with label C#. Show all posts

Ever since C# 3.0 introduced extension methods alongside LINQ, developers have relied on the this parameter modifier on static methods to augment existing types without altering their source code or inheriting from them. While this approach revolutionized fluent collection querying, it remained confined strictly to instance methods, leaving properties, indexers, static factories, and user-defined operators out of reach.

 

With the release of C# 14 running on the .NET 10 LTS runtime—and early previews of C# 15 exploring extension indexers on .NET 11—Microsoft has delivered a comprehensive paradigm shift: Extension Member Declarations. In this architectural guide, we explore the new extension block syntax, implement extension properties and static factory members, examine Roslyn Intermediate Language (IL) emission, and demonstrate how this next-generation capability refactors enterprise domain logic into clean, decoupled architectures.

Published by on under .Net | .NET 10

The continuous evolution of the C# programming language consistently focuses on removing boilerplate code while amplifying developer expressiveness and mechanical runtime sympathy. Today, modern enterprise applications are built upon the robust LTS foundation of C# 14 running on .NET 10, while preview releases of C# 15 and .NET 11 continue to test future language innovations.

 

Among the most anticipated enhancements in modern C# is the official introduction of field-backed properties powered by the contextual `field` keyword, alongside deeply expressive pattern-matching syntax. In this architectural deep dive, we explore how these features revolutionize clean code refactoring and streamline domain-driven software design in .NET 10.

Published by on under .Net | .NET 10

In high-throughput microservices, real-time gaming engines, and financial computing systems, minimizing managed heap allocations is one of the most effective strategies for eliminating Garbage Collection (GC) pauses and maximizing application throughput.

 

As of today, the stable production foundation powering enterprise software is C# 14 running on .NET 10, while preview releases for C# 15 and .NET 11 continue to advance the runtime. In this practical technical guide, we explore zero-allocation idioms, span-based buffer slicing, SIMD-accelerated searches, and frozen collections to help you write high-performance C# code.

Published by on under .Net | C#

The C# programming language continues its remarkable journey as one of the most performant, elegant, and versatile languages in the global software industry. As of today, the latest stable releases powering production enterprise workloads are C# 14 and .NET 10, with the community already exploring experimental features in preview builds for C# 15 and .NET 11.

 

In this beginner-friendly technical guide, we break down the most impactful modern language additions—including dedicated lock objects, expanded params collections, and memory safety patterns—using clear before-and-after code comparisons to help you write faster, cleaner code.

Published by on under .Net | C#

The C# programming language has come a remarkably long way since its early days, continuously evolving into one of the most expressive, performant, and versatile languages in modern computing. Today, with modern .NET innovations, writing high-performance enterprise applications has become smoother and more intuitive than ever.

 

Whether you are architecting large-scale microservices, crafting responsive web APIs, or building AI-driven solutions, keeping pace with language enhancements is essential for every developer. In this comprehensive guide, we explore the newest language capabilities, memory efficiencies, and practical patterns that will elevate your daily engineering workflow.

Published by on under .Net | C#

Hello geeks! If you have been following the tech trends lately, you already know that artificial intelligence is fundamentally reshaping how we build software today. As C# developers, it is crucial for us to adapt to these massive changes and start bringing intelligent, autonomous features into our existing enterprise applications.

 

Today, we are going to explore how to build your very first multi-agent system using the powerful Microsoft AutoGen framework directly within your familiar .NET environment. Let's dive right in and learn how to make multiple AI entities seamlessly converse, write code, and solve complex problems together.

Published by on under .Net | AI Workflow

Microsoft releases Visual Studio 2022 version 17.2, the second supported long-term servicing channel for Visual Studio 2022. This version of Visual Studio will be supported with fixes and security updates for 18 months through January 2024. Visual Studio 2022 version 17.2 adds new improvements to the C# and .NET experiences, new Git performance and experiences, updates for C++ developers, and new Azure tools for local development and deployment.

Published by on under .Net | C#

Microsoft releases the next major version of the .NET Framework. The latest .NET Framework 5.0 also includes support for C# 9 and F# 5, along with a broad set of new features and improvements. With .NET 5 as the first release of unified implementation of .NET Framework, Microsoft targets a much larger group of developers to migrate their .NET code.

 

If you are looking for .NET 5.0, here you can get the links to download the latest version for Windows, macOS, and Linux. You will need Visual Studio 16.8 or later to use .NET 5.0 on Windows and the latest version of Visual Studio for Mac on macOS.

Published by on under .Net | C#

If you are using COM components on your .NET code, you might be already aware of the Marshal.ReleaseComObject and Marshal.FinalReleaseComObject, which are used to release the managed reference to Runtime Callable Wrapper (RCW) of the COM object.

 

If both are used to release COM objects from memory, and you are unsure which one to use, then this post will help you to learn the differences between the calls.

Published by on under .Net | C#

If you are using .NET Framework 2.0 or .NET Framework 3.5, and getting unexpected Runtime Error while repeatedly calling the System.Net.NetworkInformation.Ping.Send method from C# code, this is due to an issue which got resolved in .NET Framework 4.0 and above.

 

Today, we are going to discuss about the issue, the root cause and the workaround to resolve this issue targeting .NET Framework version older than 4.0.

Published by on under .Net | C#

It's often require to parse a string value to another data type, like integer, and there exists a confusion among the developers whether to use the Parse method or the TryParse method that the framework provides to us.

 

In this post, we will discuss the difference between each of those two methods and guide you to understand and pick the preferable one. Continue reading to know more.

Published by on under .Net | C#

Let's continue our 'Back to Basics' series. It's often an interview question to get an idea of the basic knowledge of a candidate. This is one of the simple question that an interviewer may ask during an interview and you should also know this while writing your code.

 

In this post, we are again going to discuss on the basics and this time we will learn the difference between null string and empty string.

Published by on under .Net | C#

StringCollection class is a spcialized collection type present in .NET Framework class libraries. The name itself represents it as a collection of strings. It exposes common methods and properties to manage string collection.

 

If you do not know about this class, in this post we are going learn about it's properties, methods and learn how to use it.

Published by on under .Net | C#

In last few articles we have discussed about NPOI libraries for .NET. There could be some cases, while reading Excel files, you may get an exception with 'The supplied spreadsheet seems to be Excel 5.0/7.0 (BIFF5) format. POI only supports BIFF8 format' as message.

 

In this quick tip, we are going to discuss about this issue, the way to handle it and the way to read the same Excel workbook content.

Published by on under .Net | C#

In the last two articles, we have learned how to use the NPOI library to read Excel 2007 (.xlsx) and Excel 97-2003 (.xls) file format. We have also discussed more about the APIs and shared the code snippet for you to understand it easily.

 

In this article, we will learn how to read Excel 95 and older workbooks easily using the free Apache NPOI libraries in your C#/.NET applications.

Published by on under .Net | C#

In the last article, we have discussed about the NPOI library and then learned how to read Excel 2007 file formats using the free, open sourced NPOI library. I hope, the code snippet was clear and easy to understand.

 

In this article, we will learn how to read Excel 97-2003 workbooks easily using the free Apache NPOI libraries in your C#/.NET applications.

Published by on under .Net | C#

Recently, we have learned how to read Excel workbooks using the Microsoft Office COM APIs. As you may already know that the COM APIs are slow while performing operation, we will see another way to read the content which is faster.

 

In this article, we will learn how to read Excel 2007 workbooks using the Apache NPOI libraries which is available freely to use in your application.

Published by on under .Net | C#

You would like to build an application/addin that reads outlook mail and notify the user or would like to do some other operations based on your business need. For this, you will need to use the Microsoft Outlook APIs.

 

Today we are going to see, how this can be done using the Microsoft.Office.Interop.Outlook.dll to read the email from Outlook context and extract the data.

Published by on under .Net | C#

Microsoft released the final version of Visual Studio 2017 and is currently available for download. This release brings a new lightweight and modular installation experience, that you will really love. This also brings a lot of new features to accelerate your development productivity.

 

Find the links below to download the latest version of the Visual Studio 2017, an IDE which every developer must need.

Published by on under .Net | C#