views:

130

answers:

3

Hello I'm in trouble with SlimDX samples, which just pretend to support VS 2005. Well there are VS2005 solution/project files but source code itself contains C# 3.0 new language features (mostly automatic properties). It would be hell to convert this stuff to C# 2.0 by hand. Is there any tool, which does it automatically? Thanks!

A: 

Try compiling sources with C# 3.0 compiler and then use Reflector + FileDisassembler to dump decompiled sources to C# 2.0-compatible files.

Anton Gogolev
+1  A: 

I know that the freely available CodeRush Express does this, as I've already used it. The function is called "Create Backing Store". There are also other refactorings in there, I'm sure that converting to/from inferred types ('var') is also possible.

Dave Van den Eynde
thanks, but I'm unable to get CodeRush Express working in VS 2005. It installed normally, but I don't see it anywhere in VS. Thanks for help.
True, it's not like it's in the menu's or anything, but if you place your cursor on an automatic property, you should see a blue underscore (similar to the red underscore). Also, hitting the key ctrl+` should show you CodeRush'es refactoring menu.
Dave Van den Eynde
False, because I had to repair DXCore package, which finally integrated into VS. Stupid installer...
So, did it work after all?
Dave Van den Eynde
+1  A: 

Resharper will certainly convert automatic properties to properties with a backing field with a couple of clicks.

It will also process a batch of files based on standards that you define so you might be able to get it to do what you need.

Robin M