diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/NativeMethods.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/NativeMethods.cs
index d207641584..54f176beac 100644
--- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/NativeMethods.cs
+++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/NativeMethods.cs
@@ -556,19 +556,11 @@ internal static class DiaSourceObject
public static IDiaDataSource GetDiaSourceObject()
{
- var currentDirectory = new ProcessHelper().GetCurrentProcessLocation();
+ var nativeDllDirectory = new ProcessHelper().GetNativeDllDirectory();
- IntPtr modHandle = IntPtr.Zero;
- if (IntPtr.Size == 8)
- {
- modHandle = LoadLibraryEx(Path.Combine(currentDirectory, "x64\\msdia140.dll"), IntPtr.Zero, 0);
- }
- else
- {
- modHandle = LoadLibraryEx(Path.Combine(currentDirectory, "x86\\msdia140.dll"), IntPtr.Zero, 0);
- }
+ IntPtr modHandle = LoadLibraryEx(Path.Combine(nativeDllDirectory, "msdia140.dll"), IntPtr.Zero, 0);
- if(modHandle == IntPtr.Zero)
+ if (modHandle == IntPtr.Zero)
{
throw new COMException(string.Format(Resources.Resources.FailedToLoadMsDia));
}
diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs
index e463046c8e..eca17c7099 100644
--- a/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs
+++ b/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs
@@ -41,6 +41,18 @@ public interface IProcessHelper
/// Location of test engine.
string GetTestEngineDirectory();
+ ///
+ /// Gets the location of native dll's, depending on current process architecture..
+ ///
+ /// Location of native dll's
+ string GetNativeDllDirectory();
+
+ ///
+ /// Gets current process architecture
+ ///
+ /// Process Architecture
+ PlatformArchitecture GetCurrentProcessArchitecture();
+
///
/// Gets the process id of test engine.
///
diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs
index aa147a1aad..feaaa76502 100644
--- a/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs
+++ b/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs
@@ -16,6 +16,8 @@ namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions
///
public partial class ProcessHelper : IProcessHelper
{
+ private static readonly string ARM = "arm";
+
///
public object LaunchProcess(string processPath, string arguments, string workingDirectory, IDictionary envVariables, Action