Category: C#
C# Compiler Error – CS0601 the dllimport attribute must be specifie
In this blog post, you’ll learn more about the C# Compiler Error – CS0601 and the related message description C# Compiler Error Code CS0601 C# Compiler Description for the Code :CS0601 The DllImport attribute must be specified on a method marked ‘static’ and ‘extern’
How to Navigate from One Page to Another in Windows Phone 8 using Hyperlink Button?
Below is a sample code snippet demonstrating how to navigate from a page to another in Windows Phone 8 using Hyperlink Button. How to Navigate from One Page to Another in Windows Phone 8 using Hyperlink Button? Assume that the current page in “MainPage.xaml” and the “ACCode.xaml” is the destination page. One can use the code XAML <HyperlinkButton Content=”GoToAC” NavigateUri=”/ACCode.xaml” HorizontalAlignment=”Left” Margin=”73,292,0,0″ VerticalAlignment=”Top” Height=”57″ Width=”244″…
C# Compiler Error – CS0508 ‘{0}’: return type must be ‘{2}’ to matc
In this blog post, you’ll learn more about the C# Compiler Error – CS0508 and the related message description C# Compiler Error Code CS0508 C# Compiler Description for the Code :CS0508 ‘{0}’: return type must be ‘{2}’ to match overridden member ‘{1}’
C# Compiler Error – CS8716 there is no target type for the default
In this blog post, you’ll learn more about the C# Compiler Error – CS8716 and the related message description C# Compiler Error Code CS8716 C# Compiler Description for the Code :CS8716 There is no target type for the default literal.
How to perform Shallow Copy in C# ?
To perform Shallow copy in C# , you can use the this.MemberwiseClone() method. How to perform Shallow Copy in C# ? Below is a sample code snippet that contains a method ShallowCopy to make a copy of the object.
DateTime and Null value in C#
Assume that you want a variable of type DateTime and you would like to have the uninitialized value or null value , you can use the nullable DateTime type. DateTime and Null value in C# When you define a DateTime variable and dont initialize it , the default value is the DateTime.MinValue. You can simply define the type as Nullable DateTime as shown in the…
C# Compiler Error – CS8152 ‘{0}’ does not implement interface membe
In this blog post, you’ll learn more about the C# Compiler Error – CS8152 and the related message description C# Compiler Error Code CS8152 C# Compiler Description for the Code :CS8152 ‘{0}’ does not implement interface member ‘{1}’. ‘{2}’ cannot implement ‘{1}’ because it does not have matching return by reference.
C# Compiler Error – CS1954 the best overloaded method match ‘{0}’ f
In this blog post, you’ll learn more about the C# Compiler Error – CS1954 and the related message description C# Compiler Error Code CS1954 C# Compiler Description for the Code :CS1954 The best overloaded method match ‘{0}’ for the collection initializer element cannot be used. Collection initializer ‘Add’ methods cannot have ref or out parameters.
How to Get the File Version of the Assembly in .NET (C#)?
The developers can use the methods and properties available in the FileVersionInfo class to retrieve the File Version of the Assembly in .NET (C#). How to Get the File Version of the Assembly in .NET (C#)? Below is a sample code snippet demonstrating how to retrieve it.
C# Compiler Error – CS0708 ‘{0}’: cannot declare instance members i
In this blog post, you’ll learn more about the C# Compiler Error – CS0708 and the related message description C# Compiler Error Code CS0708 C# Compiler Description for the Code :CS0708 ‘{0}’: cannot declare instance members in a static class
SelectMany Example in LINQ and C#
Below is a sample source code demonstrating the usage of the SelectMany method in LINQ and C#. One of the usage of the SelectMany is to return the flat list an avoid returning the lists of lists. SelectMany Example in LINQ and C#
C# Compiler Error – CS0711 static classes cannot contain destructor
In this blog post, you’ll learn more about the C# Compiler Error – CS0711 and the related message description C# Compiler Error Code CS0711 C# Compiler Description for the Code :CS0711 Static classes cannot contain destructors