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

ubuntu-latest: Failing to run NET6 app due to missing Microsoft.NETCore.App #6925

Closed
2 of 10 tasks
gregory-paidis-sonarsource opened this issue Jan 16, 2023 · 8 comments
Closed
2 of 10 tasks
Assignees
Labels
Area: .NET Core bug report investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Ubuntu

Comments

@gregory-paidis-sonarsource

Description

After the latest update in ubuntu-latest we started having issues in our Azure pipeline while running a NET6 app with the error:

/usr/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(376,5):
 error NETSDK1127: The targeting pack Microsoft.NETCore.App is not installed. Please restore and try again.

Executing dotnet --list-sdks inside the VM shows:

6.0.404 [/usr/share/dotnet/sdk]
7.0.101 [/usr/share/dotnet/sdk]

Executing dotnet --info inside the VM shows:

========================== Starting Command Output ===========================
/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/039e26df-14cb-44e1-bd8d-5aa83db5ddf9.sh
.NET SDK (reflecting any global.json):
 Version:   6.0.404
 Commit:    be4f3ec411

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.404/

Host:
  Version:      7.0.2
  Architecture: x64
  Commit:       d037e070eb

.NET SDKs installed:
  6.0.404 [/usr/share/dotnet/sdk]
  7.0.101 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.12 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.12 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  /home/vsts/work/1/s/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

This seems oddly similar to this ticket that a teammate of mine made some time ago.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

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

Image version and build link

Image: ubuntu-22.04
Version: 20230109.1

Is it regression?

Yes, it worked before commit c82cd67

Expected behavior

Run the App without a runtime error.

Actual behavior

Having an error:

/usr/share/dotnet/sdk/7.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(376,5):
 error NETSDK1127: The targeting pack Microsoft.NETCore.App is not installed. Please restore and try again.

Repro steps

Could not reproduce this locally.

Changing the image to ubuntu-18.04 seems to solve the issue on the pipeline, at least.

@erik-bershel erik-bershel added Area: .NET Core OS: Ubuntu investigate Collect additional information, like space on disk, other tool incompatibilities etc. and removed needs triage labels Jan 16, 2023
@erik-bershel
Copy link
Contributor

Hey @gregory-paidis-sonarsource!
I'm not sure it is the same situation but according to my little investigation the same method will work for you here. You can use setup-dotnet task or wait untill new image rollout.
More info about reasons you may find here.

@erik-bershel erik-bershel self-assigned this Jan 16, 2023
@gregory-paidis-sonarsource
Copy link
Author

yeah, @erik-bershel , I installed the latest .NET 7 Sdk to latest and got the same issue on Windows as well.
I cannot reproduce it, but if I find a way to, I will open an issue to the .NET repo.

Just leaving this here, to let you know I do not think it is platform(ubuntu)-specific.

@erik-bershel
Copy link
Contributor

@gregory-paidis-sonarsource yes, it is not a really platform specific. It is more about compability of .Net platforms. As it was mentioned in issue sometimes it happens when you installing both of .Net 7 and 6 on the same machine. We'll see how next build would help you. And in case we got new compability bug, not the same I described, we'll think about another possibility to help you with broaken build. It works right now with old Ubuntu image because of process of retirement - no updates, no preinstalled comability issues.

@erik-bershel
Copy link
Contributor

Hey @gregory-paidis-sonarsource!
New Ubuntu images shiped. May I ask you to try it again?

@erik-bershel
Copy link
Contributor

Hi @gregory-paidis-sonarsource, any updates? How it works right now for you?

@gregory-paidis-sonarsource
Copy link
Author

Hey @erik-bershel , sorry for the delay. I will try to use the latest image again today.
I will inform you soon if our Linux steps work.

Thanks for asking!

@gregory-paidis-sonarsource
Copy link
Author

gregory-paidis-sonarsource commented Jan 23, 2023

hey @erik-bershel, it works. Could you share, at a high level, what changed?

Thanks again for the fix!

@erik-bershel
Copy link
Contributor

@gregory-paidis-sonarsource glad to see it. Main change that supposed been fix issue and did it is .NET Core SDK: 7.0.101 -> 7.0.102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: .NET Core bug report investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Ubuntu
Projects
None yet
Development

No branches or pull requests

2 participants