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...