Skip to content

Commit 764cfe1

Browse files
committed
Fixed .Net Core reports saving to test bin directory
1 parent be3309b commit 764cfe1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/TestStack.BDDfy/Reporters/Writers/FileWriter.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ private static string GetDefaultOutputDirectory
2020
{
2121
get
2222
{
23+
24+
#if NET40
2325
string codeBase = typeof(DiagnosticsReporter).Assembly().CodeBase;
2426
var uri = new UriBuilder(codeBase);
2527
string path = Uri.UnescapeDataString(uri.Path);
2628
return Path.GetDirectoryName(path);
29+
#else
30+
var basePath = AppContext.BaseDirectory;
31+
return Path.GetFullPath(basePath);
32+
#endif
2733
}
2834
}
2935
}

src/TestStack.BDDfy/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"imports": "dnxcore50",
3030
"dependencies": {
3131
"NETStandard.Library": "1.6.0",
32+
"System.AppContext": "4.1.0",
3233
"System.Linq.Expressions": "4.1.0",
3334
"System.Reflection": "4.1.0",
3435
"System.Reflection.TypeExtensions": "4.1.0",

0 commit comments

Comments
 (0)