Skip to content

Commit baf7df2

Browse files
committed
First working version.
1 parent 1a65425 commit baf7df2

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

GenerateHighlightContent/GenerateHighLight.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public string GenerateHighLightCode(HighLightParameter parameter)
5050

5151
if (_section == null)
5252
throw new FileNotFoundException("ConfigurationManager.GetSection(\"HighLightSection\") failed!");
53-
var workingDirectory = Path.Combine(ProcessHelper.GetAssemblyLocationDirectory, _section.FolderName);
53+
var workingDirectory = Path.Combine(ProcessHelper.GetDirectoryFromPath(Assembly.GetCallingAssembly().Location), _section.FolderName);
5454

5555
ProcessHelper helper = new ProcessHelper(workingDirectory, _section.ProcessName);
5656
helper.Arguments = GenerateArguments(inputFileName, outputFileName);

Helper/ProcessHelper.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ public static string GetAssemblyLocationDirectory
3030
{
3131
get
3232
{
33-
string assemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
33+
string assemblyDirectory = Path.GetDirectoryName(Assembly.GetCallingAssembly().Location);
3434
return assemblyDirectory;
3535
}
3636
}
3737

38+
3839
#endregion
3940

4041
#region -- Constructor --
@@ -75,5 +76,13 @@ public void ProcessStart()
7576
if (!p.HasExited) p.WaitForExit();
7677
}
7778
}
79+
80+
81+
public static string GetDirectoryFromPath(string path)
82+
{
83+
string assemblyDirectory = Path.GetDirectoryName(path);
84+
return assemblyDirectory;
85+
86+
}
7887
}
7988
}

0 commit comments

Comments
 (0)