I'm currently hosting OSRM locally on my machine to build a routing application. When the application starts, a bool ServiceAvailable
is checked with a test query to see if the application is available and running locally. I want to be able to start the OSRM application should this bool
return false. I found a StackOverflow link with a similar issue and tried to implement it, but the application doesn't load. Here's my current code:
private void StartOSRMService()
{
Process process = new Process();
process.StartInfo.WorkingDirectory = @"C:\";
process.StartInfo.UseShellExecute = false;
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = "/c cd users/james/desktop/osrm/osrm-backend/osrm_release";
process.StartInfo.Arguments = "/c osrm-routed wales-latest.osrm";
}
The method is ran but the service never starts. In other methods, my code breaks due to a Http.Web
request error, due to the lack of the service.