tag:help.appveyor.com,2012-11-13:/discussions/problems/677-xunit-20-supportAppVeyor: Discussion 2018-10-19T08:16:41Ztag:help.appveyor.com,2012-11-13:Comment/341407932015-03-26T10:05:04Z2015-03-26T10:05:04ZxUnit 2.0 support<div><p>Add <code>nuget restore</code> to "Before build script". Worked
like a charm: <a href="https://ci.appveyor.com/project/FeodorFitsner/toxiproxy-net">https://ci.appveyor.com/project/FeodorFitsner/toxiproxy-net</a></p>
<p>Consider <a href="https://docs.nuget.org/consume/package-restore/migrating-to-automatic-package-restore">
getting rid of .nuget folder</a> and using <code>nuget
restore</code> for restoring packages.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/341407932015-03-26T11:05:30Z2015-03-26T11:05:32ZxUnit 2.0 support<div><p>Cool - works like a charm.<br>
I will need to loo at Automatic Package Restore as well.<br>
Thanks again.</p></div>Marktag:help.appveyor.com,2012-11-13:Comment/341407932015-04-09T17:15:23Z2015-04-16T21:30:12ZxUnit 2.0 support<div><p>What is the minimum that is required to get the xUnit v.2 tests
working?</p>
<p>This a default build script with no appveyor.yml file. It
mentions <code>%xunit20%\xunit.console.x86</code> so it's
recognised xUnit v.2. Nuget restore is working and then launching
<a href="https://fsprojects.github.io/Paket/">Paket</a> which is
also working.</p>
<pre>
<code>Discovering tests...OK
%xunit20%\xunit.console.x86 "C:\projects\featureflagger\FeatureFlagger.Tests\bin\Debug\FeatureFlagger.Tests.dll" -appveyor
xUnit.net console test runner (32-bit .NET 4.0.30319.34209)
Copyright (C) 2015 Outercurve Foundation.
Discovering: FeatureFlagger.Tests
System.ArgumentException: Unknown test framework: Could not find xunit.dll or xunit.execution.desktop.dll.
Parameter name: C:\projects\featureflagger\FeatureFlagger.Tests\bin\Debug\FeatureFlagger.Tests.dll
Command exited with code 1</code>
</pre></div>richard.bogletag:help.appveyor.com,2012-11-13:Comment/341407932015-04-09T17:26:39Z2015-04-09T17:26:39ZxUnit 2.0 support<div><p>Have you tried doing <code>nuget restore</code> in "Before build
script"? There is a custom <code>.targets</code> file in xunit 2.0
that copies <code>xunit.execution.desktop.dll</code> to build
output folder (see <a href="https://github.com/FeodorFitsner/xunit-20-tests/blob/master/Xunit20Tests_AnyCPU/Xunit20Tests_AnyCPU.csproj#L3">
this import</a> in a test xunit 2.0 project). Looks like this file
should exist <em>before</em> build starts.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/341407932015-04-09T19:17:19Z2015-04-16T21:30:12ZxUnit 2.0 support<div><p>The <code>nuget restore</code> is in the Build tab's "Before
build script" by default (I think). It may be that Paket isn't
doing exactly the same thing. I'll have to check by switching back
to nuget for package management as a trial. The complete build
result, however, implies that Paket is getting it right.</p>
<pre>
<code>Build started
git clone -q --branch=master git://github.com/Boggin/FeatureFlagger.git C:\projects\featureflagger
git checkout -qf c3e856fa9336dab1fa169d8c3b85a1a6cb260339
nuget restore
Installing 'Paket 0.35.8'.
Successfully installed 'Paket 0.35.8'.
"C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe" "FeatureFlagger.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
Microsoft (R) Build Engine version 12.0.31101.0
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.
Paket version 0.35.8.0
Downloading Microsoft.Composition 1.0.30 to C:\Users\appveyor\AppData\Local\NuGet\Cache\Microsoft.Composition.1.0.30.nupkg
Microsoft.Composition 1.0.30 unzipped to C:\projects\featureflagger\packages\Microsoft.Composition
6 seconds - ready.
Paket version 0.35.8.0
2 seconds - ready.
FeatureFlagger.Behaviours -> C:\projects\featureflagger\FeatureFlagger.Behaviours\bin\Debug\FeatureFlagger.Behaviours.dll
Paket version 0.35.8.0
2 seconds - ready.
FeatureFlagger.Domain -> C:\projects\featureflagger\FeatureFlagger.Domain\bin\Debug\FeatureFlagger.Domain.dll
FeatureFlagger.ConfigurationReaders -> C:\projects\featureflagger\FeatureFlagger.ConfigurationReaders\bin\Debug\FeatureFlagger.ConfigurationReaders.dll
CSC : warning CS1607: Assembly generation -- The version '0.0.1-alpha003' specified for the 'file version' is not in the normal 'major.minor.build.revision' format [C:\projects\featureflagger\FeatureFlagger\FeatureFlagger.csproj]
FeatureFlagger -> C:\projects\featureflagger\FeatureFlagger\bin\Debug\FeatureFlagger.dll
Paket version 0.35.8.0
Downloading xunit.core 2.0.0 to C:\Users\appveyor\AppData\Local\NuGet\Cache\xunit.core.2.0.0.nupkg
Downloading Should 1.1.20 to C:\Users\appveyor\AppData\Local\NuGet\Cache\Should.1.1.20.nupkg
Downloading xunit.abstractions 2.0.0 to C:\Users\appveyor\AppData\Local\NuGet\Cache\xunit.abstractions.2.0.0.nupkg
Downloading NSubstitute 1.8.1.0 to C:\Users\appveyor\AppData\Local\NuGet\Cache\NSubstitute.1.8.1.nupkg
Downloading xunit 2.0.0 to C:\Users\appveyor\AppData\Local\NuGet\Cache\xunit.2.0.0.nupkg
Downloading xunit.assert 2.0.0 to C:\Users\appveyor\AppData\Local\NuGet\Cache\xunit.assert.2.0.0.nupkg
Downloading xunit.extensibility.core 2.0.0 to C:\Users\appveyor\AppData\Local\NuGet\Cache\xunit.extensibility.core.2.0.0.nupkg
xunit.abstractions 2.0.0 unzipped to C:\projects\featureflagger\packages\xunit.abstractions
Should 1.1.20 unzipped to C:\projects\featureflagger\packages\Should
xunit 2.0.0 unzipped to C:\projects\featureflagger\packages\xunit
NSubstitute 1.8.1.0 unzipped to C:\projects\featureflagger\packages\NSubstitute
xunit.assert 2.0.0 unzipped to C:\projects\featureflagger\packages\xunit.assert
xunit.extensibility.core 2.0.0 unzipped to C:\projects\featureflagger\packages\xunit.extensibility.core
xunit.core 2.0.0 unzipped to C:\projects\featureflagger\packages\xunit.core
7 seconds - ready.
FeatureFlagger.Tests -> C:\projects\featureflagger\FeatureFlagger.Tests\bin\Debug\FeatureFlagger.Tests.dll
FeatureFlagger.Example.Console -> C:\projects\featureflagger\FeatureFlagger.Example.Console\bin\Debug\FeatureFlagger.Example.Console.exe
Discovering tests...OK
%xunit20%\xunit.console.x86 "C:\projects\featureflagger\FeatureFlagger.Tests\bin\Debug\FeatureFlagger.Tests.dll" -appveyor
xUnit.net console test runner (32-bit .NET 4.0.30319.34209)
Copyright (C) 2015 Outercurve Foundation.
Discovering: FeatureFlagger.Tests
System.ArgumentException: Unknown test framework: Could not find xunit.dll or xunit.execution.desktop.dll.
Parameter name: C:\projects\featureflagger\FeatureFlagger.Tests\bin\Debug\FeatureFlagger.Tests.dll
Command exited with code 1</code>
</pre></div>richard.bogletag:help.appveyor.com,2012-11-13:Comment/341407932015-04-09T19:24:22Z2015-04-09T19:24:22ZxUnit 2.0 support<div><p>OK, nuget restore downloaded paket, but now paket runs as part
of the build, so when msbuild build starts and csproj is read that
xunit targets file does not exist yet voiding its import. Is there
a way to run paket and restore <em>all</em> packages before msbuild
starts?</p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/341407932015-04-16T21:26:27Z2015-04-16T21:30:12ZxUnit 2.0 support<div><p>I tried to put "paket install" after the "nuget restore" in
"Before build script" which will restore all the packages before
the build as you suggest, Feodor but as paket isn't installed on
the build server this fails:</p>
<pre>
<code>Build started
git clone -q --branch=master git://github.com/Boggin/FeatureFlagger.git C:\projects\featureflagger
git checkout -qf c3e856fa9336dab1fa169d8c3b85a1a6cb260339
nuget restore
Installing 'Paket 0.35.8'.
Successfully installed 'Paket 0.35.8'.
paket install
'paket' is not recognized as an internal or external command,
operable program or batch file.
Command exited with code 1</code>
</pre>
<p>So I somehow need a reference to the newly installed paket.exe
that I can call or paket needs to be on the build server or I need
to move away from the settings that are available through the UI
and try to create a better build script to run.</p>
<p>Any suggestions welcomed.</p></div>richard.bogletag:help.appveyor.com,2012-11-13:Comment/341407932015-04-16T23:18:18Z2015-04-16T23:18:18ZxUnit 2.0 support<div><p>I think you should call it as:</p>
<pre>
<code>packages\Paket.0.35.8\tools\paket install</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/341407932015-04-21T04:35:30Z2015-04-21T04:35:31ZxUnit 2.0 support<div><p>I get something even weirder:<br></p>
<pre>
<code>Discovering tests...OK
%xunit20%\xunit.console.x86 "C:\projects\impostor#packages\xunit.core.2.0.0\build\monoandroid\xunit.execution.MonoAndroid.dll" -appveyor
xUnit.net console test runner (32-bit .NET 4.0.30319.34209)
Copyright (C) 2015 Outercurve Foundation.<br><br>
<br>Discovering: xunit.execution.MonoAndroid
System.ArgumentException: Unknown test framework: Could not find xunit.dll or xunit.execution.desktop.dll.
Parameter name: C:\projects\impostor#packages\xunit.core.2.0.0\build\monoandroid\xunit.execution.MonoAndroid.dll
Command exited with code 1</code>
</pre>
<p>Even though my project has nothing to do with MonoAndroid.</p></div>Andrey Shchekintag:help.appveyor.com,2012-11-13:Comment/341407932015-04-21T04:37:56Z2015-04-21T04:38:04ZxUnit 2.0 support<div><p>I have a custom nuget.config that puts packages into
<code>#packages</code>.</p></div>Andrey Shchekintag:help.appveyor.com,2012-11-13:Comment/341407932015-04-21T04:41:52Z2015-04-21T04:41:52ZxUnit 2.0 support<div><p>It's just <code>xunit.execution.MonoAndroid</code> is not added
to the ignored list of auto-discovered assemblies. Either add
<code>xunit.execution.MonoAndroid.dll</code> to exclude assemblies
list or use your own test script command to call xunit runner with
correct assembly.</p>
<p>I'll add an issue to fix that by the next release.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/341407932015-04-21T05:26:40Z2015-04-21T05:26:41ZxUnit 2.0 support<div><p>That solved it, thanks!</p></div>Andrey Shchekin