Recently I have been working on project that uses GeoIP library and is hosted on Windows Azure. My first approach was to use local storage and pass database path to LookupService constructor. But it turned out that this approach is a little bit inconvenient, because with each deployment I have to copy GeoIP databse file to all Azure instances. That's why I figured out it would be much easier to use blobs to store database file and share it among instances and deployments. But for now it is impossible as the only way to create LookupService is to pass path to the database file.
I got the same kind of issue, so I just added a new constructor:
public LookupService(Stream databaseStream, int options)
if (databaseStream == null)
throw new ArgumentException(String.Empty, @"databaseStream");
if (!databaseStream.CanRead || !databaseStream.CanSeek)
throw new ArgumentException(@"input stream must support reading and seeking", "databaseStream");
this.file = databaseStream;
dboptions = options;
I'll probably submit a patch soon with this and other enhancements (such as throwing exceptions instead of writing to the console when an error occurs).
Thank you for your effort and I'm looking forward to your patch.
Hey! Sorry for the delay... pull requests are apparently never taken into account here, so we did a fork here: https://github.com/criteo/geoip-api-csharp2
It's synced with the maxmind code, but bugx are fixed, namespaces are right and you have some optims as a bonus.