visual studio - VS2008 targeting .NET 2.0 doesn't stop me from using C# 3 features -
I had a VS2005 solution and wanted to get VS 2005 for the new year. I was mostly happy with the upgrade process and it was pleasantly surprised to see that my build script works primarily still.
My question is around multi-targeting feature - .NET 3.5 is not installed on my server., So I have to continue targeting the Net 2.0. It has worked, mostly, but I came to know that I can do things like
var returnMe = "result:" + result.ToString ();
... and still debug this project successfully
When I got that server up to the build server, the build failed, saying "var" "Was not defined.
So, what should I expect?
Any ideas?
The problem is that the build server does not have the right compiler You can make it on your workstation, okay?
Many .NET 3.0 "FEATURES" are just syntax bits that come back to the CLR2 code in a timely manner. var
is one of them - when it is compiled, the compiler converts var to the appropriate type.
Comments
Post a Comment