Category Archives: dotnet

Posts about .NET languages and framework.

C# Automatic Properties can have Attributes

The MSDN documentation for Automatic Properties (a C# 3 language feature) states that attributes are not valid on automatic properties. This is not true, the following code compiles and works as expected:

public class Data
{
[XmlAttribute]
public int SomeNumber { get; set; }
}

class Program
{
static void Main(string[] [...]

Microsoft Source Analysis Released

My team at work uses a fantastic Visual Studio add-in called Source Analysis to ensure consistency in our C# code formatting, commenting and organisation.

Source Analysis has now been released for the whole world to use, for free! The free download is available at the MSDN Code Gallery:
Source Analysis at Code Gallery
There’s also a blog [...]