Category: C#

Example of Composite Anonymous Types in C#

The feature of anonymous types can be felt specially when we work with the composite type rather than the simple types. The below example is more like you are defining an inline class without actually having the definition. Example of Composite Anonymous Types in C# Below is an example of the anonymous type in C# that demonstrates the composite anonymous type. Note that you will…

How to Get the File Size in C# ?

If you need a way to get the size of a file in your C# program , you can use the Length property of the FileInfo class. How to Get the File Size in C# ? FileInfo.Length returns the length of the file in bytes.

How to refer to the file in Windows Phone app using ms-appx ?

When using the Speech recognition , you might refer to the Voice Command Definition file within your project . Assuming that the file name is AbundantcodeGrammar.xml . you might refer to the file with the ms-appx as shown below. new Uri(“ms-appx:///AbundantcodeGrammar.xml”,UriKind.RelativeOrAbsolute); When referring to the file at runtime , there are times when you might receive an error 0x80070002 error – The system cannot find…

C# Compiler Warning – CS8021 no value for runtimemetadataversion foun

In this blog post, you’ll learn more about the C# Compiler Warning – CS8021 and the related message description C# Compiler Warning Code CS8021 C# Compiler Description for the Code :CS8021 No value for RuntimeMetadataVersion found. No assembly containing System.Object was found nor was a value for RuntimeMetadataVersion specified through options.