Retarget EntryPoint to be based off the location of Wabbajack.Common.dll

This commit is contained in:
Timothy Baldridge 2020-04-10 16:55:32 -06:00
parent c8120adf8b
commit e947919462

View File

@ -145,13 +145,16 @@ namespace Wabbajack.Common
} }
} }
/// <summary>
/// Returns the full path the folder that contains Wabbajack.Common. This will almost always be
/// where all the binaries for the project reside.
/// </summary>
/// <exception cref="ArgumentException"></exception>
public static AbsolutePath EntryPoint public static AbsolutePath EntryPoint
{ {
get get
{ {
var location = Assembly.GetEntryAssembly()?.Location ?? null; var location = Assembly.GetExecutingAssembly().Location ?? null;
if (location == null)
location = Assembly.GetExecutingAssembly().Location ?? null;
if (location == null) if (location == null)
throw new ArgumentException("Could not find entry point."); throw new ArgumentException("Could not find entry point.");
return ((AbsolutePath)location).Parent; return ((AbsolutePath)location).Parent;