Skip to content

Commit

Permalink
chore: fix dotnet build produced
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Aug 22, 2022
1 parent c349ab4 commit 52baf74
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Playwright/Helpers/Driver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,19 @@ internal static string GetExecutablePath()
DirectoryInfo assemblyDirectory = new(AppContext.BaseDirectory);
if (!assemblyDirectory.Exists || !File.Exists(Path.Combine(assemblyDirectory.FullName, "Microsoft.Playwright.dll")))
{
#if NETFRAMEWORK
var assemblyLocation = typeof(Playwright).Assembly.Location;
#else

#pragma warning disable SYSLIB0012
var assemblyLocationFileUrl = typeof(Playwright).Assembly.CodeBase;
#pragma warning restore SYSLIB0012
if (string.IsNullOrEmpty(assemblyLocationFileUrl))
{
throw new PlaywrightException("Unable to find Microsoft.Playwright.dll");
}
var assemblyLocation = new Uri(assemblyLocationFileUrl).LocalPath;
#endif
assemblyDirectory = new FileInfo(assemblyLocation).Directory;
}

Expand Down

0 comments on commit 52baf74

Please sign in to comment.