Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit ccdaa96

Browse files
committed
use AppContext.BaseDirectory when entry assembly location is empty
1 parent 2825191 commit ccdaa96

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Titanium.Web.Proxy/Certificates/Cache/DefaultCertificateDiskCache.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ private string getRootCertificateDirectory()
129129
assemblyLocation = Assembly.GetEntryAssembly().Location;
130130
}
131131

132+
// single-file app string.Empty location
133+
if (assemblyLocation == string.Empty)
134+
{
135+
assemblyLocation = AppContext.BaseDirectory;
136+
}
137+
132138
string path = Path.GetDirectoryName(assemblyLocation);
133139

134140
rootCertificatePath = path ?? throw new NullReferenceException();

0 commit comments

Comments
 (0)