Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DotNet test runs fail for a x86 projects - Microsoft.WindowsDesktop.App (net core 6) is missing on windows-latest runner, #485

Open
kerrywicks opened this issue Nov 27, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@kerrywicks
Copy link

kerrywicks commented Nov 27, 2023

Description:
This has been an issue since Wednesday 22nd November. DotNet test runs fail for a x86 projects with an error message stating that Microsoft.WindowsDesktop.App (net core 6) is missing on windows-latest (github action) runner.

This issue was raised here: actions/runner-images#8859 (reported as an Azure devops issue), but was closed with a claim that it is not image related, and it was recommended to raise the issue here. I'm hoping this is the right place to raise this! If I should raise this elsewhere, please let me know and feel free to close this.

Task version:
setup-dotnet@v3

Platform:
Windows

Runner type:
Hosted - github action + Azure devops

Repro steps:
Here are the tasks I am attempting to run:

# Setup
- name: Install .NET Core
  uses: actions/setup-dotnet@v3
  with:
    dotnet-version: 6.0.x

This task does pass, but gives the message:

dotnet-install: .NET Core SDK with version '6.0.417' is already installed.

The next task is to run the unit tests for a windows app project:

- name: Execute Domino.UnitTests.LabelFacade
  run: dotnet test ".\Mozart\Domino.UnitTests.LabelFacade\bin\x86\Release\net6.0-windows\Domino.UnitTests.LabelFacade.dll" --verbosity m

This task fails with the following message:

Testhost process for source(s) 'D:\a\DA-development\DA-development.\Mozart\Domino.UnitTests.LabelFacade\bin\x86\Release\net6.0-windows\Domino.UnitTests.LabelFacade.dll' exited with error: You must install or update .NET to run this application.
App: D:\a\DA-development\DA-development\Mozart\Domino.UnitTests.LabelFacade\bin\x86\Release\net6.0-windows\testhost.x86.exe
Architecture: x86
Framework: 'Microsoft.WindowsDesktop.App', version '6.0.0' (x86)
.NET location: C:\Program Files (x86)\dotnet
The following frameworks were found:
8.0.0 at [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]

Expected behavior:
I'd expect .net 6 to install if it is in fact missing for both x86 and x64, and as such I would expect the testhost to be able to run tests successfully.

Actual behavior:
The image thinks that .Net is installed at the requested version - however, the x86 portion for .net tests seem to be missing. Note that x86 non-test projects build and run successfully as expected.

@kerrywicks kerrywicks added bug Something isn't working needs triage labels Nov 27, 2023
@dusan-trickovic
Copy link

Hello, @kerrywicks ! Thank you for reporting this issue, we will look into it :)

@MelDommer
Copy link

We are also seeing this issue for x86 tests. Started within the last 2 weeks.

@mnr3395
Copy link

mnr3395 commented Nov 28, 2023

We are also facing the issue for x86 tests from last week

@fredrikloch
Copy link

We are having the same issue in our builds, starting on the 20th of November. Our current workaround is to use a self hosted agent where we manually install windows desktop development packages.
Attaching a msbuild.zip from a build that fails using this following build configuration:

trigger: none
jobs:
##
# Configuration
##
- job: Build_HSH
  pool:
    vmImage: 'windows-latest'
  steps:

    - checkout: self  # self represents the repo where the initial Pipelines YAML file was found
      clean: true  # whether to fetch clean each time
      submodules: true

    - task: UseDotNet@2
      inputs:
        packageType: 'sdk'
        version: 6.x
        performMultiLevelLookup: true

    - task: UseDotNet@2
      inputs:
        packageType: 'runtime'
        version: 6.x
        performMultiLevelLookup: true

    - powershell: |
        dotnet --info
      displayName: 'dotnet info'

    - powershell: dotnet tool restore
      displayName: 'dotnet tool restore'

    - powershell: |
        dotnet --info
      displayName: 'dotnet info'
      
    - task: DotNetCoreCLI@2
      displayName: 'Test HSH'
      inputs:
        command: 'test'
        arguments: "-s test.runsettings -v:n --logger:trx /bl"

    - task: PublishBuildArtifacts@1
      displayName: 'Publish Artifact: build-log'
      condition: always()
      inputs:
        PathtoPublish: '$(Build.Repository.LocalPath)/msbuild.binlog'
        ArtifactName: 'build-log'

To trigger the issue, we've used the following csproj settings:
"Code project"

  <PropertyGroup>
    <TargetFramework>net6.0-windows</TargetFramework>
    <UseWPF>true</UseWPF>
    <Platforms>x86</Platforms>
    <Configurations>Debug;Release</Configurations>
    <Nullable>enable</Nullable>
    <IsPackable>false</IsPackable>
    <implicitUsings>enable</implicitUsings>
  </PropertyGroup>

"Test project"

  <PropertyGroup>
    <TargetFramework>net6.0-windows</TargetFramework>
    <Platforms>x86</Platforms>
    <Configurations>Debug;Release</Configurations>
    <Nullable>enable</Nullable>
    <ImplicitUsings>true</ImplicitUsings>
  </PropertyGroup>

@phil6789
Copy link

phil6789 commented Dec 1, 2023

Same her. VSTest@2 doesnt work either.
Changed my 2 NET6 unit test projects (one for x86 one for x64) to NET8, the assembly under test itself remains NET6.
Works again. 😃

@brenda-vh
Copy link

I have a fork that fixes the issue but would like it resolved upstream. This is just a hack to make sure we have the right dotnet version. It should be supported properly by Github Actions IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants