Closed JohannesEH closed 2 years ago
Maybe something like Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase)
would work instead?
Nah, CodeBase returns a Uri so it would be more like Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().GetName().CodeBase).LocalPath)
The GetName
has a boolean parameter specifying if the name should be the shadow copied (true) or original (false). It defaults to false. Then to unwrap the file uri
Because IIS is shadow copying files you will get a path like
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\b7dc711f\a2c2b98f\assembly\dl3\8b76e845\0097b45e_1094d701\
when you callPath.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
, and not the original path of the dll.I'm not sure how to fix this in a way that works across all runtimes and environments. It would be nice if you could provide a pdfium.dll path yourself.