Migrating from VS 2008 to VS 2010 (4.0) and VB.NET to C#
I know there are tools to migrate VS 2008 application to VS 2010. But anyone knows a tool that can also convert VB.NEt code to C开发者_如何学运维# code.
I recently had to convert 6 months worth of code from vb.net to C#. Based on a blog by Scott Hanselman I checked out the online code convertor from Telerik. The conversion itself took seconds. About 8 hours later after some manual fixes, I had a fully compiling C# code base. Not bad for 6 months worth of code. And best of all is that it's a free tool.
Check out the online conversion tool here or the more useful batch convertor here.
Load an assembly up in Reflector and you can get a disassembly in C#.
It will not be perfect, as it works off the IL (which is lower level than C# or VB.NET), so you end up with funny iterator blocks and strangely named variables (that may be illegal names in C#). These patterns are pretty easy to figure out and fix, though time consuming.
Yes, there are tools out there that do this. A simple google search will avail you well.
However, in my experience, the tools that are out there that do this don't do it well at all. Even the best ones aren't worth what you pay for them. They mangle your code, they leave dependencies on the Microsoft.VisualBasic namespace, and they generally leave you with a serious case of buyer's remorse (even if you didn't pay a dime).
This one is pretty good: http://www.developerfusion.com/tools/convert/vb-to-csharp/
精彩评论