Skip to content
GrahamTheCoder edited this page Dec 11, 2021 · 28 revisions

General advice

Before performing any conversion, it's recommended to:

  • Ensure you have no uncommitted changes in your version control system. This will make it easy to see the result of the conversion, and discard any parts you don't want.
  • Create a new branch
  • Ensure your solution compiles for maximum conversion accuracy.
  • Split out any files over about 5000 lines (using partial classes if needed). Converting two 5000 line files is usually significantly faster than converting one 10000 line file. This may be slightly less of an issue with the command line.
  • Immediately after conversion, commit the result, this will make it easy to report issues
    • I'd always recommend separating automated from manual steps in commits initially - it makes it so much easier to make use of the history to locate/correct mistakes, after all, what else is the history for?
    • Converting a project to a totally different language is inherently somewhat messy and has a whole bunch of steps as you've just described. Trying to pretend it all happened in one go will just make life harder 3 months down the line when you notice an issue and can't figure out at which point in the process it got introduced.
    • If being on a branch isn't enough, and for whatever reasons you need to sweep the mess under the rug later, in git it's pretty straightforward using rebase (there's even an option in GitHub to squash rebase a branch).

Once your output is compiling, I'd recommend setting up a .editorconfig and using: dotnet-format to format things the way you like.

Clone this wiki locally