-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix loading additional Handlebars.Net.Helpers dll's when running appl…
…ication from commandline using 'dotnet run' (#97) * Fix loading additional Handlebars.Net.Helpers dll's when running application from commandline using 'dotnet run' * . * var paths = options.CustomHelperPaths ?? new List<string> * ... * fix
- Loading branch information
Showing
4 changed files
with
90 additions
and
41 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/Handlebars.Net.Helpers/Compatibility/AppContextHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.IO; | ||
|
||
namespace HandlebarsDotNet.Helpers.Compatibility; | ||
|
||
internal static class AppContextHelper | ||
{ | ||
public static string GetBaseDirectory() | ||
{ | ||
#if NETSTANDARD1_3_OR_GREATER || NET6_0_OR_GREATER | ||
return AppContext.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar); | ||
#else | ||
return AppDomain.CurrentDomain.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar); | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters