Converting from VB.NET to Mercury
Mercury provides the option to easily convert an existing
.vbproj (and also
.csproj) for use with Elements.
There are three main ways to trigger a conversion:
When opening a
slnfile that contains one or more
.vbprojprojects in Fire or Water, these projects will show in the project tree, but grayed out as "unsupported". You can right-click an individual project and choose "Convert to Elements" from the context menu. This will convert the project in place, create a new
.elmemetsfile, and replace it in the solution. If the solution contains more than one
.csproj, the context menu will also provide the option to convert all projects to Elements in one go. This path has the benefit that it can adjust all project references between the projects to point to the converted
.elementsprojects, as well.
You can use the "File|Import|Visual C# or Visual Basic.NET Project" menu item in Fire or Water to open and convert a
.vbprojdirectly. This will automatically create a new
.elementsfile based on the original project file. If a
.slnwith a matching name already exists in the same folder, it will be preserved, and a second Silution will be created for the new project.
You can use the
EBuildcommand line tool with the
--convertto convert convert projects from the Terminal/Command Line or from a batch script. On Mac, you will need to install the External Compiler to use the command line tool.
All three paths lead to the same conversion logic. The
.vbproj will be read and analyzed, and a new
.elements project will be created based on its contents. The
.vbproj will not be changed.
When converting projects within an open solution, as an added benefit, the IDE will also try to adjust any project references from existing Elements projects to the project being converted.
The conversion performs a number of steps to try and bring most settings and features over. This includes but might extend beyond:
- Removing legacy and unsupported settings.
- Adjusting settings that use different names in Elements, such as
Linq to SQL" (see here).
- Dropping unnecessary
Please let us know if you encounter any problems converting projects, of have suggestions for more derails that should be carried over.
If you choose to "Convert all projects to Elements" in one go, the IDe will be avle to adjust all (well-formed) project references to the converted projects to the new filenames.
If you convert a single project to Elements, the IDE will adjust project references to it in existing Elements projects, but it will not touch any not-yet-converted
Therefore, the best option for converting a solution with several inter-dependent projects would be to convert all projects in one go.