diff --git a/Rollbar/Common/RuntimeEnvironmentUtility.cs b/Rollbar/Common/RuntimeEnvironmentUtility.cs index 19394077..8ccdd9eb 100644 --- a/Rollbar/Common/RuntimeEnvironmentUtility.cs +++ b/Rollbar/Common/RuntimeEnvironmentUtility.cs @@ -32,6 +32,11 @@ public static string GetSdkRuntimeLocationPath() if (path != null) { + if (Directory.Exists(Path.Combine(path, "bin"))) + { + return Path.Combine(path, "bin"); + } + return path; } #endif diff --git a/UnitTest.Rollbar/Common/RuntimeEnvironmentUtilityFixture.cs b/UnitTest.Rollbar/Common/RuntimeEnvironmentUtilityFixture.cs index 2da71dcd..87b1b79e 100644 --- a/UnitTest.Rollbar/Common/RuntimeEnvironmentUtilityFixture.cs +++ b/UnitTest.Rollbar/Common/RuntimeEnvironmentUtilityFixture.cs @@ -5,6 +5,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Diagnostics; + using System.IO; using System.Linq; using System.Text; using System.Threading; @@ -40,5 +41,26 @@ public void TestGetSdkRuntimeLocationPath() Assert.IsFalse(string.IsNullOrWhiteSpace(path)); } + [TestMethod] + public void TestGetSdkRuntimeLocationPathWithBinSubfolder() + { + var expectedPath = Path.Combine(AppContext.BaseDirectory, "bin"); + try + { + Directory.CreateDirectory(expectedPath); + + var path = RuntimeEnvironmentUtility.GetSdkRuntimeLocationPath(); + Assert.IsNotNull(path); + Assert.IsFalse(string.IsNullOrWhiteSpace(path)); + Assert.IsTrue(path.EndsWith("bin")); + } + finally + { + if (Directory.Exists(expectedPath)) + { + Directory.Delete(expectedPath); + } + } + } } }