This project is read-only.


Failing build with XUnit and Windows store components


The sample code for this failure is located at GitHub:

My failure scenario is not typical: instead of two projects (the component under the test and the test project) in contains a third project (TestUtils) with various test utils. Since this third project uses some of XUnit classes, it needs to reference XUnit, however it does not have any tests, so it's not a deployment target. Since there is no XUnit Nuget package that supports Windows Store, I created TestUtils project using XUnit project template (availabe in VS gallery). TestUtils is referenced by Tests project, and this is what makes build fail: both projects are defined as deployment targets, one references the other, and when I build them I get the following error:

5>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets(374,9): error APPX1101: Payload contains two or more files with the same destination path 'xunit.dll'. Source files:
5>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets(374,9): error APPX1101: D:\Projects\GitHub\Simple.NExtLib.Tests\libs\Windows\v8.0\ExtensionSDKs\XUnit\2.0\References\CommonConfiguration\neutral\xunit.dll
5>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets(374,9): error APPX1101: D:\Projects\GitHub\Simple.NExtLib.TestUtils\bin\Debug\xunit.dll

In order to resolve this I believe it would be sufficient to run Install-Package XUnit on TestUilts, but as I said, for the time being there is not such Nuget package. The only possible way to add XUnit to a Windows Store project is through creation of the Windows Store XUnit test project template, but then it's treated as tests container.

An ugly workaround is to add links to TestUtils source files to a Tests project. Then build succeeds and tests run fine. Hopefully this can be resolved in a proper way.

Best regards


BradWilson wrote Mar 15, 2014 at 6:00 PM

This is resolved in v2.0 alpha build 2595.