private static bool CheckoutLicense() { ArcGISLicenses lic = new ArcGISLicenses(); lic.Checkout(); _msg.Debug("Successfully checked out ArcGIS license."); return(true); }
private static Grpc.Core.Server Run(string[] args, out IServiceHealth health) { Grpc.Core.Server server; try { MicroserverArguments arguments; string configFilePath; if (!ConfigurationUtils.TryGetArgumentsFromConfigFile( args, _configFileName, out arguments, out configFilePath)) { var parsedArgs = Parser.Default.ParseArguments <MicroserverArguments>(args); parsedArgs.WithParsed(a => { arguments = a; }); } ConfigureLogging(arguments.VerboseLogging, _logConfigFileName); if (configFilePath != null) { _msg.InfoFormat("Using service configuration defined in {0}", configFilePath); } else { _msg.DebugFormat( "Program was called with the following command line arguments: {0}{1}", Environment.NewLine, arguments); } _msg.DebugFormat("Host: {0}", arguments.HostName); _msg.DebugFormat("Port: {0}", arguments.Port); _msg.InfoFormat("Checking out ArcGIS license..."); ArcGISLicenses.InitializeAo11(); EnvironmentUtils.SetConfigurationDirectoryProvider( ConfigurationUtils.GetAppDataConfigDirectoryProvider()); server = StartServer(arguments, out health); } catch (Exception ex) { _msg.Error("An error occurred in QA microservice startup.", ex); throw; } return(server); }