mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-18 09:35:38 -05:00
Separating Migration into its own project (#1828)
* Moving Migration service to its own project * Adding loc files to the project * Adding Migration to build * Adding Migration Integration Tests * Trying loops * Fixing params * Fixing indent * Cleaning up yaml * Getting command line arg for auto flush log * Adding tde service
This commit is contained in:
64
src/Microsoft.SqlTools.Migration/Program.cs
Normal file
64
src/Microsoft.SqlTools.Migration/Program.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.SqlTools.Extensibility;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.Migration
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
private const string ServiceName = "MicrosoftSqlToolsMigration.exe";
|
||||
|
||||
internal static void Main(string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
CommandOptions commandOptions = new CommandOptions(args, ServiceName);
|
||||
if (commandOptions.ShouldExit)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string logFilePath = "MicrosoftSqlToolsMigration";
|
||||
if (!string.IsNullOrWhiteSpace(commandOptions.LogFilePath))
|
||||
{
|
||||
logFilePath = Path.Combine(commandOptions.LogFilePath, logFilePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
logFilePath = Logger.GenerateLogFilePath(logFilePath);
|
||||
}
|
||||
|
||||
Logger.Initialize(SourceLevels.Verbose, logFilePath, "Migration", commandOptions.AutoFlushLog);
|
||||
|
||||
Logger.Verbose("Starting SqlTools Migration Server...");
|
||||
|
||||
ExtensionServiceHost serviceHost = new ExtensionServiceHost(
|
||||
new ExtensibleServiceHostOptions
|
||||
{
|
||||
HostName = "Migration",
|
||||
HostProfileId = "SqlTools.Migration",
|
||||
HostVersion = new Version(1, 0, 0, 0),
|
||||
InitializeServiceCallback = (server, serivce) => { }
|
||||
});
|
||||
|
||||
serviceHost.RegisterAndInitializeService(new MigrationService());
|
||||
serviceHost.WaitForExit();
|
||||
Logger.Verbose("SqlTools Migration Server exiting....");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user