-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Problem
PR #2851 will introduce tests specific to x86/x64 environments but winforms build infrastructure is broken and always runs tests in x64 when running within Visual Studio, even when explicitly selecting x86 in the VS test explorer toolbar.
Workaround
run tests from console via .\build.cmd -platform x86 -test
Root Cause / Fix
- this was a bug in VS which has been fixed in 16.4
- you need to update the nuget package
Microsoft.Net.Test.Sdkto version 16.4 or newer- currently this package is pulled in by the SDK in version 16.1.1, so you either need to update the SDK or override the nuget package import
- even when importing the package with the fix you'll still run into an error because winforms only installs the x64 sdk when running the build scripts; you also need to install the x86 sdk or VS complains
- according to this log it looks like aspnetcore already is able to install both sdks, so you should be able to do something similar
Proof of Concept
- edit
System.Windows.Forms.Primitives.Tests.csprojand add an explicit package reference<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4" /> - download and install the x86 sdk manually [edit] got the link wrong here and don't remember the right version to download, just download the link variation ending in
x86.exeof whatever build-local.ps1 installs - observe that you can now run both
PRINTDLGW_32_ensure_layoutandPRINTDLGW_64_ensure_layoutfrom PR fix:PrintDialognot shown #2851 inside VS (you can switch the bitness of the test runner in the test explorer toolbar)
Reactions are currently unavailable