1
0

Using AppContext.BaseDirectory - as Assembly.Location might not be available in single-file applications.

This commit is contained in:
2022-06-20 18:55:18 +02:00
parent 65bca0a922
commit 42ae72a1b7
3 changed files with 8 additions and 11 deletions

View File

@@ -208,7 +208,7 @@ namespace Microsoft.EntityFrameworkCore
if (!Path.IsPathRooted(path))
{
if (string.IsNullOrWhiteSpace(options.AbsoluteBasePath))
options.AbsoluteBasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
options.AbsoluteBasePath = AppContext.BaseDirectory;
path = Path.Combine(options.AbsoluteBasePath, path);
}