HomeCSharpPage 26

CSharp

Showing 501 - 520 of 961 results
When using the auto property initializer and trying to initialize the auto property with a value from method , you...
C# Error CS1640 – foreach statement cannot operate on variables of type ‘{0}’ because it implements multiple instantiations of ‘{1}’;...
C# Error CS0841 – Cannot use local variable ‘{0}’ before it is declared Reason for the Error & Solution Cannot...
C# Error CS0591 – Invalid value for argument to ‘{0}’ attribute Reason for the Error & Solution Invalid value for...
C# Error CS0844 – Cannot use local variable ‘{0}’ before it is declared. The declaration of the local variable hides...
C# Error CS8333 – Cannot return {0} ‘{1}’ by writable reference because it is a readonly variable Reason for the...
Compiler Error CS0138 – A using namespace directive can only be applied to namespaces; ‘type’ is a type not a...
C# Error CS1576 – The line number specified for #line directive is missing or invalid Reason for the Error &...
C# Error CS4008 – Cannot await ‘void’ Reason for the Error & Solution Cannot await ‘void’ Example The following sample...
C# Compiler Error CS0159 – No such label ‘label’ within the scope of the goto statement Reason for the Error...
Here’s a small tip on using the string class better in C# to fill a string with specified repeated characters. You can...
There are many occasions when you might want to return multiple values from a method in C#. Below are some...
C# Error CS1996 – Cannot await in the body of a lock statement Reason for the Error & Solution Cannot...
C# Error CS8176 – Iterators cannot have by-reference locals Reason for the Error & Solution Iterators cannot have by-reference locals...
C# Compiler Error CS0131 – The left-hand side of an assignment must be a variable, property or indexer Reason for...
C# Compiler Error CS0463 – Evaluation of the decimal constant expression failed with error: ‘error’ Reason for the Error You’ll...
The code snippet shown in this blog post demonstrates how you can get the enumeraor from a range of elements...
Problem: You want to convert a simple JSON string to a C# and vice versa object using Json.NET. Solution Use...
C# Compiler Error CS0132 – ‘constructor’ : a static constructor must be parameterless Reason for the Error You will receive...
C# Compiler Error CS0549 – ‘function’ is a new virtual member in sealed class ‘class’ Reason for the Error You...