Skip to content

Commit

Permalink
[tests] fix F5 for Windows device tests (#22835)
Browse files Browse the repository at this point in the history
If you try to F5 the Windows device tests, you'll get an error:

    Error (active) APPX1101 Payload contains two or more files with the same destination path 'xunit.runner.utility.netcoreapp10.dll'. Source files:
    ...\Microsoft.Maui.Cache\NuGet\packages\xunit.runner.visualstudio\2.8.0\build\net6.0\xunit.runner.utility.netcoreapp10.dll
    ...\Microsoft.Maui.Cache\NuGet\packages\xunit.runner.utility\2.6.6\lib\netcoreapp1.0\xunit.runner.utility.netcoreapp10.dll	Controls.DeviceTests (net8.0-windows10.0.19041.0)
    ...\Microsoft.Maui.Cache\NuGet\packages\microsoft.windowsappsdk\1.5.240311000\buildTransitive\Microsoft.Build.Msix.Packaging.targets

This is due to dotnet/arcade using:

https://github.com/dotnet/arcade/blob/2c08708d18855f2e2779ac5d0623a5978751c4f3/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnit/XUnit.targets#L13

For now, let's set `$(DisableArcadeTestFramework)` and it won't import
`XUnit.targets` from arcade.

After these changes, I can F5 again.
  • Loading branch information
jonathanpeppers authored Jun 4, 2024
1 parent 8e97f32 commit 78b9840
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<!--<Nullable>enable</Nullable>-->
<NoWarn>$(NoWarn),CA1416</NoWarn>
<ExcludeMicrosoftNetTestSdk>true</ExcludeMicrosoftNetTestSdk>
<DisableArcadeTestFramework>true</DisableArcadeTestFramework>
</PropertyGroup>

<Import Project="$(MauiSrcDirectory)MultiTargeting.targets" />
Expand Down
4 changes: 4 additions & 0 deletions src/Microsoft.Maui.TestUtils.DeviceTests.Runners.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<DisableArcadeTestFramework>true</DisableArcadeTestFramework>
</PropertyGroup>

<ItemGroup>
<CompilerVisibleProperty Include="RootNamespace" />
<CompilerVisibleProperty Include="ApplicationId" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<NoWarn>$(NoWarn);CA1416</NoWarn>
<WarningsNotAsErrors>$(WarningsNotAsErrors);XC0022;XC0023</WarningsNotAsErrors>
<ExcludeMicrosoftNetTestSdk>true</ExcludeMicrosoftNetTestSdk>
<DisableArcadeTestFramework>true</DisableArcadeTestFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/TestUtils/src/DeviceTests/TestUtils.DeviceTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<AssemblyName>Microsoft.Maui.TestUtils.DeviceTests</AssemblyName>
<Nullable>enable</Nullable>
<ExcludeMicrosoftNetTestSdk>true</ExcludeMicrosoftNetTestSdk>
<DisableArcadeTestFramework>true</DisableArcadeTestFramework>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 78b9840

Please sign in to comment.