views:

70

answers:

4

Thus far, I've worked with C# 3.0 for all my applications and I've never worked with C# 2.0. But now I have to work with C# 2.0 for my next project.

  • What are the factors to be considered when migrating to an earlier version of C#?
  • Is it tough to adapt/live with am earlier version?
  • What are the classes/libraries that I'll miss when moving from C# 3.0 to C# 2.0?
+2  A: 

I would recommend Jon Skeet's C# in Depth, as he starts out with 2.0 then moves onto 3.0 (as I understand it, a new edition is coming that will also cover 4.0). His book divides the different versions of the language nicely and goes into good detail, giving you exactly what you are looking for. I guess in your case just read the book backwards :)

Matt Greer
+2  A: 

Linq. If you don't use that, it's probably a breeze.

jdv
+2  A: 

Is it that you have to target .NET 2.0, but can compile using 2008 / 2010?

If so, you'll still have all of the features of C# 3.0, including extension methods, lambdas, query comprehensions and implicit typing.

If you download LinqBridge, you'll have that, too.

I'm using this setup for .NET 2.0-targeted shareware app right now. All I really miss for this particular project is WPF. :-)

Ben M
If you go this route, I'd just be careful to make sure that the person in charge fully understands what you're doing and is ok with it. There may be some actual reason why they're stuck in the past with 2.0 - maybe automated build servers don't have the 3.0 compiler, maybe the other developers don't want to learn new stuff, maybe the ReSharper license your company has only covers 2.0 and will not function when you use VS2005 with .NET 3.0, who knows...Just something to think about.
Joe Enos
+1  A: 

Don't know if you mean 3.0 or 3.5...but it's all going to depend on what language/framework features you're used to using. If you're using anonymous types, WCF, WPF, WF, or LINQ, you're going to have to find alternatives. If you're using lambda expressions, object/collection initializers, implicit variable declaration, and extension methods, then you're going to have to write things slightly differently, but it shouldn't be a huge deal. Aside from that, you should be pretty safe.

Joe Enos