I’ve inherited a project written mostly in VB. I’d like to maintain what I have in VB while slowly converting to C# when I can. The only way I’ve found to do this is to create a separate C# project. However, this causes problems because of dependencies and references. I can’t have VBProject reference CSharpProject and vice versa because it creates a circular reference. This is a problem because I need both projects to be able to reference the other. Is there a better way to do this, or am I stuck writing in VB (or completely translating to C#)?
Also, these projects are in the same solution. Shouldn’t I be able to import/use them without creating a reference or some other easier way?
There’s no getting around having to remove the circular references.
When I’ve faced a similar situation in the past, converting from language A to language B, I started by refactoring bits of the language A code so that they were independent of the majority of the code base. Then I’d translate those isolated pieces to language B and integrate so that the main program was now depending on the new modules. Eventually, all that was left was the main program.
It took time, but this bottom-up approach was very effective and I ended up with a much more modular program.