Category: C#

C# Compiler Error – CS0138 a ‘using namespace’ directive can only b

In this blog post, you’ll learn more about the C# Compiler Error – CS0138 and the related message description C# Compiler Error Code CS0138 C# Compiler Description for the Code :CS0138 A ‘using namespace’ directive can only be applied to namespaces; ‘{0}’ is a type not a namespace. Consider a ‘using static’ directive instead

C# Compiler Error – CS1975 the constructor call needs to be dynamic

In this blog post, you’ll learn more about the C# Compiler Error – CS1975 and the related message description C# Compiler Error Code CS1975 C# Compiler Description for the Code :CS1975 The constructor call needs to be dynamically dispatched, but cannot be because it is part of a constructor initializer. Consider casting the dynamic arguments.

C# Compiler Error – CS0767 cannot inherit interface ‘{0}’ with the

In this blog post, you’ll learn more about the C# Compiler Error – CS0767 and the related message description C# Compiler Error Code CS0767 C# Compiler Description for the Code :CS0767 Cannot inherit interface ‘{0}’ with the specified type parameters because it causes method ‘{1}’ to contain overloads which differ only on ref and out

Auto Property Initializers in C# 6.0

The .NET Framework 3.0 introduced the auto-implemented properties which was quite useful but it had one drawback . This did not have an option to specify the default value to the property . Here’s an example of the auto-implemented property in C#. If you had to specify the default value to property , you must either initialize the value in the constructor or by specifying…