Category: C#
C# Compiler Error – CS1105 extension method must be static
In this blog post, you’ll learn more about the C# Compiler Error – CS1105 and the related message description C# Compiler Error Code CS1105 C# Compiler Description for the Code :CS1105 Extension method must be static
C# Compiler Error – CS8006 forwarded type ‘{0}’ conflicts with type
In this blog post, you’ll learn more about the C# Compiler Error – CS8006 and the related message description C# Compiler Error Code CS8006 C# Compiler Description for the Code :CS8006 Forwarded type ‘{0}’ conflicts with type declared in primary module of this assembly.
C# Compiler Warning – CS3000 methods with variable arguments are not
In this blog post, you’ll learn more about the C# Compiler Warning – CS3000 and the related message description C# Compiler Warning Code CS3000 C# Compiler Description for the Code :CS3000 Methods with variable arguments are not CLS-compliant
C# Compiler Error – CS0200 property or indexer ‘{0}’ cannot be assi
In this blog post, you’ll learn more about the C# Compiler Error – CS0200 and the related message description C# Compiler Error Code CS0200 C# Compiler Description for the Code :CS0200 Property or indexer ‘{0}’ cannot be assigned to — it is read only
How to get the CommandLine of the Current Application in C# ?
You might need to get the information that contains the commandline which is used to execute the current application in C#. How to get the CommandLine of the Current Application in C# ? You can use the CommandLine property of the System.Environment class that provides the necessary information including the application name. The output of the program would be Command line of the Abundantcode app…
C# Compiler Error – CS8072 an expression tree lambda may not contai
In this blog post, you’ll learn more about the C# Compiler Error – CS8072 and the related message description C# Compiler Error Code CS8072 C# Compiler Description for the Code :CS8072 An expression tree lambda may not contain a null propagating operator.
How to Remove Objects from the List with RemoveAll in C#?
Below is a sample code snippet demonstrating How to Remove Objects from the List with RemoveAll in C#? How to Remove Objects from the List with RemoveAll in C#?
C# Compiler Warning – CS0252 possible unintended reference comparison
In this blog post, you’ll learn more about the C# Compiler Warning – CS0252 and the related message description C# Compiler Warning Code CS0252 C# Compiler Description for the Code :CS0252 Possible unintended reference comparison; to get a value comparison, cast the left hand side to type ‘{0}’
Cast Operator with Anonymous Types
Below is a sample sourecode that demonstrates the usage of the Cast Operator when using the anonymous type Cast Operator with Anonymous Types When the element within the List cannot be converted to the target type, you will receive an exception “InvalidCastException”.
C# Compiler Error – CS0260 missing partial modifier on declaration
In this blog post, you’ll learn more about the C# Compiler Error – CS0260 and the related message description C# Compiler Error Code CS0260 C# Compiler Description for the Code :CS0260 Missing partial modifier on declaration of type ‘{0}’; another partial declaration of this type exists
The ? (ternary) Operator in C#
The ? Operator is the ternary operator and takes the following form Expression1? Expression2: Expression3; The Expression1 is an expression which returns Boolean result. Expression2 is considered if the Expression1 is true else Expression2 is taken.
How to select top 5 records from List using LINQ in C#?
Below is a sample code snippet demonstrating on how to select top 5 records from a list using LINQ in C# using the Take extension method… How to select top 5 records from List using LINQ in C#?
C# Compiler Error – CS7020 cannot use ‘yield’ in top-level script c
In this blog post, you’ll learn more about the C# Compiler Error – CS7020 and the related message description C# Compiler Error Code CS7020 C# Compiler Description for the Code :CS7020 Cannot use ‘yield’ in top-level script code
C# Compiler Error – CS1973 ‘{0}’ has no applicable method named ‘{1
In this blog post, you’ll learn more about the C# Compiler Error – CS1973 and the related message description C# Compiler Error Code CS1973 C# Compiler Description for the Code :CS1973 ‘{0}’ has no applicable method named ‘{1}’ but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without…
C# Compiler Error – CS1715 ‘{0}’: type must be ‘{2}’ to match overr
In this blog post, you’ll learn more about the C# Compiler Error – CS1715 and the related message description C# Compiler Error Code CS1715 C# Compiler Description for the Code :CS1715 ‘{0}’: type must be ‘{2}’ to match overridden member ‘{1}’
C# Compiler Error – CS1057 ‘{0}’: static classes cannot contain pro
In this blog post, you’ll learn more about the C# Compiler Error – CS1057 and the related message description C# Compiler Error Code CS1057 C# Compiler Description for the Code :CS1057 ‘{0}’: static classes cannot contain protected members
C# Compiler Error – CS7002 unexpected use of a generic name
In this blog post, you’ll learn more about the C# Compiler Error – CS7002 and the related message description C# Compiler Error Code CS7002 C# Compiler Description for the Code :CS7002 Unexpected use of a generic name
What are the different types of comments in C#?
There are 3 different types of comments in C#. These include 1. Single Line CommentThe single line comment is specified using the symbol // Eg: // this is a AbundantCode comment 2. Multi Line CommentThe Multiline comment can be specified using the symbol /* */ Eg: /* This is a test comment */ 3. XML CommentThis is a special kind of comment which is generally…
C# Compiler Error – CS8132 cannot deconstruct a tuple of ‘{0}’ elem
In this blog post, you’ll learn more about the C# Compiler Error – CS8132 and the related message description C# Compiler Error Code CS8132 C# Compiler Description for the Code :CS8132 Cannot deconstruct a tuple of ‘{0}’ elements into ‘{1}’ variables.
C# Compiler Error – CS0072 ‘{0}’: cannot override; ‘{1}’ is not an
In this blog post, you’ll learn more about the C# Compiler Error – CS0072 and the related message description C# Compiler Error Code CS0072 C# Compiler Description for the Code :CS0072 ‘{0}’: cannot override; ‘{1}’ is not an event