Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
In my current project we’re migrating a solution from Visual FoxPro to .NET and SQL Server in a two-stage process. First the business logic will be re-written in C#, and finally the database layer will be switched to SQL Server.
To complicate things there are several tables in the database that contain sensitive data and so they are encrypted with a 3rd party utility which makes using ODBC data access impossible. Instead, all data access is done through a DLL written in FoxPro that is auto-generated from the domain model’s metadata. This DLL must be rebuilt every time the metadata changes and this currently has to be done by hand by the developer on their own machine. This is currently the manual only step in our automated build process and I’ve been looking for a way to automate it.
I’ve finally had the chance to sit down and investigate this and it turns out I can use the Foxpro COM DLL Vfp6t.dll:
string vfpProjectPath = Path.Combine( Environment.CurrentDirectory, args[0] );string outputDll = Path.Combine( Environment.CurrentDirectory, args[1] );Console.WriteLine("Building '{0}' from FoxPro project '{1}'", outputDll, vfpProjectPath );FoxApplicationClass vfp = new FoxApplicationClass( );vfp.DoCmd( String.Format( "BUILD DLL {0} FROM {1} RECOMPILE", outputDll, vfpProjectPath ) );vfp.Quit( );
The only drawback is if an error occurs during the build a nasty message box pops up which is not so great when it occurs on the automated build machine