Closed romatthe closed 6 years ago
@romatthe thanks for your report.
Yes, this is a bug. Mistakenly, the Xunit tasks currently assume that there is only one matching executable in the whole package folder. We will change this so that you can call SetFramework("net472")
to pick the executable from any framework directory you want.
I'm not sure if we should fallback to any default value here. Or if we should always throw an exception if Framework
was not set. /cc @arodus
We will fix this rather quickly. Anyway we plan to release within this week. In the meantime, you can use SetToolPath
in combination with NuGetPackageResolver
.
Thanks for the quick response, I'll give the workaround a whirl.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I'm trying to set up a Nuke build for the very first time, and I'm following along with the Getting Started page on the website. More specifically, I'm trying to build a target to execute all unit tests.
But this always throws a
System.InvalidOperationException
.Looking a bit deeper, it seems like this thrown from inside the
ToolPathResolver.GetPackageExecutable
method, more specifically on this exact line.Now, in my case,
Directory.GetFiles
is looking inside/Users/romatthe/.nuget/packages/xunit.runner.console/2.4.0
forxunit.console.exe
. Obviously this doesn't yield a single return value, as I have multiple versions of this package in thetools
directory.Whats the proper way to work around this? Setting the toolpath manually seems like a rather tricky thing to do, especially because this build should be working on both Windows, OSX and Linux.
As you've probably noticed, I'm currently working on OSX. Nuke version is
0.5.3