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

Running .net5 tests failed because .net5 framework was not found #5794

Closed
1 of 10 tasks
pmatuszewski opened this issue Jun 22, 2022 · 8 comments
Closed
1 of 10 tasks

Running .net5 tests failed because .net5 framework was not found #5794

pmatuszewski opened this issue Jun 22, 2022 · 8 comments

Comments

@pmatuszewski
Copy link

Description

Before environment update I was able to run tests for .net5 application.
Currently when tests are run following error is displayed:

Testhost process exited with error: It was not possible to find any compatible framework version
The framework 'Microsoft.WindowsDesktop.App', version '5.0.0' (x86) was not found.

  • The following frameworks were found:
    3.1.26 at [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
    6.0.6 at [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]

Platforms affected

  • Azure DevOps
  • GitHub Actions

Virtual environments affected

  • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 10.15
  • macOS 11
  • macOS 12
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Environment: windows-2019
Version: 20220614.0

Is it regression?

20220606.1

Expected behavior

It should be possible to run tests for .net5 application

Actual behavior

Running tests fails

Repro steps

  1. build .net5 project with tests using msbuild
  2. run tests e.g dotnet test apptests.dll
@miketimofeev
Copy link
Contributor

This is expected behavior as runtime component was upgraded from 5 to 6 recently https://github.com/actions/virtual-environments/pull/5749/files
image
@timheuer could you please suggest what is the best possible option to solve the issue?

@timheuer
Copy link
Contributor

@pmatuszewski .NET 5 is out of support, but you can at your own control install it on your run. Using the setup-dotnet action and specify the 5.0.x version to install prior to your subsequent commands.

@pmatuszewski
Copy link
Author

Thanks for your response. Unfortunately installing .NET 5 with setup-dotnet didn't solve the issue. The same error is returned when tests are run.
image
image

@timheuer
Copy link
Contributor

@pmatuszewski is this a public repo? I think I'll need more info to see what's going on here -- the Desktop aspect is probably the cause here but I don't know why. My .NET 5 projects are running/testing fine: https://github.com/timheuer/ClassLibrary2/runs/7007951826?check_suite_focus=true -- so I'm not sure what the diff is here (in mine using windows-2019 runner image, and both projects target net5.0)

@al-cheb
Copy link
Contributor

al-cheb commented Jul 25, 2022

@pmatuszewski, Any updates?

@al-cheb
Copy link
Contributor

al-cheb commented Jul 26, 2022

I am planning to close the thread. If you have any concerns feel free to open it.

@al-cheb al-cheb closed this as completed Jul 26, 2022
@reegeek
Copy link

reegeek commented Nov 11, 2022

Hi,
I have the same error.

The issue is that we cannot run net50 x86 test with the latest image.

On my project:
this run worked with image version 20220925.1
And not working on this run with image version 20221027.1

@reegeek
Copy link

reegeek commented Nov 11, 2022

In fact, when a runtime is integrate to a image, x64 and x86 version are installed.

With dotnet-setup you cannot specify x86.
actions/setup-dotnet#72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants