public void Copy(string executionPath)
{
if (IsRunning())
throw new InvalidOperationException("The executable is already running!");
_executionPath = executionPath;
if (!Directory.Exists(GetExecutionDirPath()))
Directory.CreateDirectory(GetExecutionDirPath());
DirectoryCopy(GetOriginalDirPath(), GetExecutionDirPath(), true);
var webConfigPath = Path.Combine(_basePath, "..", "web.config");
var targetPath = Path.Combine(GetExecutionDirPath(), "web.config");
if (File.Exists(webConfigPath) && !File.Exists(targetPath))
{
File.Copy(webConfigPath, targetPath);
}
}