Files
UnrealEngineUWP/Engine/Source/Programs/DotNETCommon/DotNETUtilities/AssemblyUtils.cs
Wes Hunt c1672d4beb Remove Remove some redundant and unused functions;
* InternalUtils::ExecutingAssemblyLocation
* InternalUtils::ExecutingAssemblyDirectory
* InternalUtils::ExecutableVersion
* CommandUtils::WriteToFile (one overload not used)
* CommandUtils::ExeFilename
* CommandUtils::ExeDirectory
* CommandUtils::CurrentDirectory
Added:
* Tools.DotNETCommon.AssemblyUtils::ExecutableVersion

[CL 2629222 by Wes Hunt in Main branch]
2015-07-22 14:00:30 -04:00

35 lines
1.0 KiB
C#

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace Tools.DotNETCommon
{
public static class AssemblyUtils
{
/// <summary>
/// Gets the original location (path and filename) of an assembly.
/// This method is using Assembly.CodeBase property to properly resolve original
/// assembly path in case shadow copying is enabled.
/// </summary>
/// <returns>Absolute path and filename to the assembly.</returns>
public static string GetOriginalLocation(this Assembly ThisAssembly)
{
return new Uri(ThisAssembly.CodeBase).LocalPath;
}
/// <summary>
/// Version info of the executable which runs this code.
/// </summary>
public static FileVersionInfo ExecutableVersion
{
get
{
return FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().GetOriginalLocation());
}
}
}
}