Category: C#

C# Compiler Error – CS1980 cannot define a class or member that uti

In this blog post, you’ll learn more about the C# Compiler Error – CS1980 and the related message description C# Compiler Error Code CS1980 C# Compiler Description for the Code :CS1980 Cannot define a class or member that utilizes ‘dynamic’ because the compiler required type ‘{0}’ cannot be found. Are you missing a reference?

Example for Multiple Levels of Namespace

using System; using System.Collections.Generic; using System.IO; using System.Linq; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; namespace App2 {     namespace App1     {         namespace App3         {             class A             {             }         } } }

How to rethrow InnnerException without losing Stack Trace in C# ?

Microsoft .NET Framework 4.5  introduced the ExceptionDispatchInfo class which lets the developers to capture an exception and rethrow it without losing the stack trace. How to rethrow InnnerException without losing Stack Trace in C# ? Below is a sample code snippet demonstrating the usage of this class.