by Kindler Chase
12. April 2008 20:34
I've been spending a fair amount of my time over the past couple of weeks digging into Windows Workflow Foundation with Visual Studio 2005 and .NET 3.0/3.5 with the assistance of Pro WF: Windows Workflow in .NET 3.5. This weekend I decided to create a virtual machine with Visual Studio 2008 and try out the new IDE. As I was building a Class in VS2008 I called upon the trusty Property snippet (aka, "prop" + tab) to generate a Property along with its backing variable. Huh? Is the snippet broken in VS2005?
Not being the brightest person, I thought there was a bug in VS2008. The resulting snippet ended up as:
public Guid InstanceId
{
get;
set;
}
What I expected was:
private Guid _instanceId;
public Guid InstanceId
{
get
{
return _instanceId;
}
set
{
_instanceId = value;
}
}
Is this a bug in Visual Studio 2008?
Nope. I come to find out that .NET 3.0/3.5 has gained Automatic Properties. I'm the first to admit that I do not fully comprehend an Automatic Property. However, I now have a little more knowledge in my arsenal.
How do I get my Visual Studio 2005 Property Snippet back into Visual Studio 2008?
I could re-hash what others have already done and add my own little twist on my method. Being the lazy developer I am, I'll just point you to a couple of good blog posts that'll steer you in the right direction:
Enjoy!