Skip to content

Commit

Permalink
Merge pull request #130 from Lombiq/issue/OSOE-76
Browse files Browse the repository at this point in the history
OSOE-76: Make WebAppConfigHelper probe the Release directory too
  • Loading branch information
Piedone authored Feb 16, 2022
2 parents a457326 + a25d362 commit a121853
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions Lombiq.Tests.UI/Helpers/WebAppConfigHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,27 @@ public static class WebAppConfigHelper
/// <returns>The absolute path to the assembly (DLL) of the application being tested.</returns>
public static string GetAbsoluteApplicationAssemblyPath(string webAppName, string frameworkFolderName = "net5.0")
{
var baseDirectory = File.Exists(webAppName + ".dll")
? AppContext.BaseDirectory
: Path.Combine(
string baseDirectory;

if (File.Exists(webAppName + ".dll"))
{
baseDirectory = AppContext.BaseDirectory;
}
else
{
var outputFolderContainingPath = Path.Combine(
AppContext.BaseDirectory.Split(new[] { "src", "test" }, StringSplitOptions.RemoveEmptyEntries)[0],
"src",
webAppName,
"bin",
"Debug",
frameworkFolderName);
"bin");

baseDirectory = Path.Combine(outputFolderContainingPath, "Debug", frameworkFolderName);

if (!Directory.Exists(baseDirectory))
{
baseDirectory = Path.Combine(outputFolderContainingPath, "Release", frameworkFolderName);
}
}

return Path.Combine(baseDirectory, webAppName + ".dll");
}
Expand Down

0 comments on commit a121853

Please sign in to comment.