What C# tools do you recommend?
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
If all you're doing is converting it then what do you hope to gain? If you're not prepared to rewrite it just leave it as it is.
-
Unless it's less than 1000 lines of code, avoid auto-conversion software. I'd strongly recommend re-designing and then re-writing it in C#. The re-design is important because things are done way differently in modern .NET than it was during the VB6 days.
Nish Nishant Consultant Software Architect Ganymede Software Solutions LLC www.ganymedesoftwaresolutions.com
Exactly. Your post is the voice of experience talking.
Jeremy Falcon
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
You clearly are looking to move to C#, but if you really want to shorten the learning curve, consider converting/rewriting to VB.NET. Once you get it to that point, there are tools that can convert to C#. Why VB.NET first? The learning curve is much shorter and at least some VB6 code will work without too much fuss. (beware of the whole int/short/long issues) If you want a direct conversion to VB.NET from VB6, I VB 2008 was the last IDE that had a migration tool.
"Go forth into the source" - Neal Morse
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
Just want to second what Nish said. Also, to plug to our old friend Tom Archer who works at Microsoft, it may be worth getting his book [^]. It's a bit dated now, but in this case that's good. It's a book that's specific about coming from a Visual Studio 6.0 world (from more of a C++ standpoint but still) to help with the fundamentals of C#. After the fundamentals, you can always read up on what's happened with the language lately... which has been a lot.
Jeremy Falcon
-
If all you're doing is converting it then what do you hope to gain? If you're not prepared to rewrite it just leave it as it is.
By "Converting" I meant re-writing while keeping all of the same functionality.
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
Given that Resharper has already been mentioned, what other tools would be useful? Well, you might want to look into NDepend[^]. I use this tool a lot to check code quality; it's really useful for showing you dependencies and telling you the cost of those dependencies for instance. Then there's unit testing (whether or not you are a fan of TDD, having well written unit tests is a real bonus). You can go with something like NUnit, the Visual Studio unit tests, xUnit or so on. Speaking of unit testing, as your code grows you might want to invest in NCrunch[^]. It's a great way to see if your code changes have broken any tests without you having to remember to run the tests yourself. There are many other tools you can add as you grow, but I'd give these a look if I were you.
This space for rent
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
Is there an underlying reason to re-write beyond the fact that the code is out of date? You may find, along with Nish's brilliant advice, that you could speed things up by wrapping the old functional parts into an API that can be called by the 'new' version. That way you don't need to rewrite everything from day 1 to get moving. Wrap the API that can be called by the new solution and then you can replace the functionality piece meal rather than all at once.
veni bibi saltavi
-
Unless it's less than 1000 lines of code, avoid auto-conversion software. I'd strongly recommend re-designing and then re-writing it in C#. The re-design is important because things are done way differently in modern .NET than it was during the VB6 days.
Nish Nishant Consultant Software Architect Ganymede Software Solutions LLC www.ganymedesoftwaresolutions.com
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
As Balboos said, delete and rewrite. Anything in VB6 is going to look like an aborted fetus in C#. Not that it doesn't look like that already in VB6. ;)
Latest Article - Class-less Coding - Minimalist C# and Why F# and Function Programming Has Some Advantages Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
-
Thanks, I will check it out. And yes I am actually re-writing a functional clone as you suggest. Sorry I did not make that clearer. The Program is around 400,000 lines of code. :omg:
-
Nish Nishant wrote:
things are done way differently in modern .NET than it was during the VB6 days
:-D :laugh: ;P ;) That is highly dependent upon who you work with ;P ;) :laugh: :-D
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
You need one of these: http://com-sub.info/Mad/Welcome And a few tabs of Anacin.
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
You should look for a low code solution. I highly recommend DevExpress XAF. What is the budget for the project? C# with DevExpress XAF. With one low code solution in C#, you produce : - WinForms - Web (touch enabled) - multi-platform Mobile app with native look and feel. Your source code is mainly the description of your objects and their relations, where you add declarative validation and other goodies via attributes. Your application creates (or updates) the database automatically (including indexes, foreign keys, necessary n-n relation tables, etc.) and produces a beautiful default UI that you can fully customize, either in Visual Studio or at run-time. The learning curve is sharp, but well worth it. Everything is done by following best design patterns. See my answer to another similar question here, that includes links to tutorials and demos: Generic Multi Purpose .NET Layered Framework[^]
-
Nish Nishant wrote:
things are done way differently in modern .NET than it was during the VB6 days
:-D :laugh: ;P ;) That is highly dependent upon who you work with ;P ;) :laugh: :-D
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
LinqPAD - http://www.linqpad.net is totally worth it. It's very nice to play around with small snippets and run them immediately / compare them to other languages.
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
I have done this - taken a large VB project (which I wrote) and converted it to a shipping product written in C#. A few things I learned 1. Don't convert the VB, write a new application. Take the lessons leaner from VB app and apply them using C# and .NET. Use it as an opportunity to improve the code and algorithms used, even if it is supposed to be functionally similar or the same. 2. Write something else in C# first. C# and VB6 are more similar than you would think but the differences are key. Write something using VS2017. Make your mistakes there. It doesn't have to be something big, just something to get you up-to-speed with it. 3. Whatever you think it will take, it will take longer. 4. Whatever you think it will take, it will take longer. 5. Consider the external parts of your VB project: OCXs References etc. If you don't have control of them it could make life tricky in C# land. 6. You asked about tools: VS2017 is the best tool you can use. Concentrate on that first!
-
I am trying to convert my VB6 code to C# (Desktop programs). I am looking for tools that will help increase my efficiency and shorten the learning curve. Any suggestions? Other than "give it up!" :laugh:
If everything seems to be going well you are obviously overlooking someone or something....
LS, I converted a few VB6 programs to C# and some more from VB.NET. When I joined the firm that I am currently working for they had a bunch of VB6 and VB.Net software and they wanted this translated to C# asap. Ofcourse the best way is to start all over, but that was not an option my boss wanted (and he is the boss so he decides). So I used VS2008 (it has a wizard for this) to translate VB6 into VB.NET.(Google will tell you how, but it is pretty straight forward). And for the VB.NET programs I used SharpDevelop 4.4 (make sure to use this version and NOT a newer version, because for some reason the took the convert option out). SharpDeveloper 4.4 (I am sure using google you can find this free software) has an option to convert VB.Net to C#. Load the VB.NET solution in SharpDevelop. Right click the solution and click Convert => C# (it has other convert options as well). You will find that is not perfect. A lot of times you will need to replace brackets like ( with [. Strings in VB.Net start counting from 1 in C# this is 0 (if you didn't use VS2008's wizard to convert from VB6 to VB.Net than you need to keep this in mind). You will need to create new screens (you can select everything and copy this to a new screen) and than make sure that the code is bound to this screen. You will also need to select for instance your buttons and select the correct click event to the click event of this button. Than when you compile there will be some references to some VB.NET stuff that cause an error which you will need to remove. Start with a simple project. If need be create a helloworld in VB6 and convert thus. I used these options to convert about 15 projects to C# and it saved us a lot of time. You will get the hang of it as to where you will need to make changes, in most cases it is the same kind of stuff that goes wrong. You will also find that VB.NET is a lot more forgiving than C#. When you work with a database and retrieve info, there will not be a conversion to string. And when you use this method you will sonn find out that you need to go through the code and add '.ToString()' when you collect info from a database. There are function in VB that have no counterpart in C# (if I am not mistaken Mid or MidStr is such a function). SharpDevelop will add some DLL so that you can still use these functions. As the majority of the applications already was in VB.Net I am not sure if there are many functions in VB6 that do not have a counterpart in VB.Net. I do not think it will be that m
-
I have been a firm believer in Rokford Lhotka's Business Objects....
-
Resharper. And don't give it up, C# isn't terribly difficult. Like an English muffin, it just has many nooks and crannies, and is infinitely better with butter(Resharper). I would suggest a functional clone rather than direct conversion, though. It's unlikely that a VB6 program is structured in a way that will work well in C#.
"There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli
Nathan Minier wrote:
Resharper.
:thumbsup:
Eric