Skip to content

Commit 2608801

Browse files
committed
#714 Improved AoT support
1 parent f75ecbb commit 2608801

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Readme.txt

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ CHANGELOG
6969

7070
5.4.4.0
7171

72+
* New: #714 Improved AoT support
7273
* New: #721 Added support for comma-separated arguments in addition to semicolon
7374

7475
5.4.3.0

src/ReportGenerator.Core/Generator.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public bool GenerateReport(
136136
// Set log level before validation is performed
137137
LoggerFactory.VerbosityLevel = reportConfiguration.VerbosityLevel;
138138

139-
Logger.Debug($"{Resources.Executable}: {typeof(Program).Assembly.Location}");
139+
Logger.Debug($"{Resources.Executable}: {AppContext.BaseDirectory}");
140140
Logger.Debug($"{Resources.WorkingDirectory}: {Directory.GetCurrentDirectory()}");
141141

142142
if (!new ReportConfigurationValidator(reportBuilderFactory).Validate(reportConfiguration))
@@ -358,7 +358,7 @@ private IConfigurationRoot GetConfiguration()
358358
try
359359
{
360360
var builder = new ConfigurationBuilder()
361-
.SetBasePath(new FileInfo(this.GetType().Assembly.Location).DirectoryName)
361+
.SetBasePath(AppContext.BaseDirectory)
362362
.AddJsonFile("appsettings.json")
363363
.AddCommandLine(args);
364364

@@ -368,7 +368,7 @@ private IConfigurationRoot GetConfiguration()
368368
{
369369
// This can happen when excuted within MSBuild (dotnet msbuild): JSON configuration gets ignored
370370
var builder = new ConfigurationBuilder()
371-
.SetBasePath(new FileInfo(this.GetType().Assembly.Location).DirectoryName)
371+
.SetBasePath(AppContext.BaseDirectory)
372372
.AddCommandLine(args);
373373

374374
return builder.Build();

src/ReportGenerator.Core/Plugin/ReflectionPluginLoader.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ private IAssemblyLoader CreateAssemblyLoader()
127127

128128
if (framework != null && framework.StartsWith(".NETCoreApp"))
129129
{
130-
var directory = new FileInfo(typeof(ReflectionPluginLoader).Assembly.Location).Directory.FullName;
131-
string path = Path.Combine(directory, "ReportGenerator.DotnetCorePluginLoader.dll");
130+
string path = Path.Combine(AppContext.BaseDirectory, "ReportGenerator.DotnetCorePluginLoader.dll");
132131

133132
if (!File.Exists(path))
134133
{

0 commit comments

Comments
 (0)