From bd082cddada15b834f70f7e9b3cad5d7a7abe85f Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Sun, 20 Aug 2017 19:01:15 +1000 Subject: [PATCH] Fixing assembly root dir resolution for non windows --- PactNet/Core/PactCoreHost.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PactNet/Core/PactCoreHost.cs b/PactNet/Core/PactCoreHost.cs index 76fce520..f271207d 100644 --- a/PactNet/Core/PactCoreHost.cs +++ b/PactNet/Core/PactCoreHost.cs @@ -16,15 +16,16 @@ internal class PactCoreHost : IPactCoreHost where T : IPactCoreHostConfig public PactCoreHost(T config) { _config = config; - - var currentDir = Directory.GetCurrentDirectory(); - var pactCoreDir = $"{currentDir}{Path.DirectorySeparatorChar}"; //OS specific version will be appended + var expectedPackage = String.Empty; #if USE_NET4X + var pactCoreDir = $"{Directory.GetCurrentDirectory()}{Path.DirectorySeparatorChar}"; //OS specific version will be appended pactCoreDir += "pact-win32"; expectedPackage = "PactNet-Windows"; #else + var pactCoreDir = $"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}"; //OS specific version will be appended + if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) { pactCoreDir += "pact-win32";