Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Rollbar/Common/RuntimeEnvironmentUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions UnitTest.Rollbar/Common/RuntimeEnvironmentUtilityFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
}
}
}