question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipeline commands fail with a dependency on maui-tizen

See original GitHub issue

Description

Trying to run unit tests on a blank Maui project fails because it needs the maui-tizen workload installed. I’ve removed all references to Tizen in the codebase yet there seems to be something in the project/tooling that requires it.

The app appears to work locally but that may be a difference in workloads installed/commands being run compared to CI.

Steps to Reproduce

  1. Create a blank MAUI app
  2. Create a unit test project for that app
  3. Pin the .NET version at .NET 6 using Global.json.
  4. Using an Azure DevOps pipeline, run dotnet test

Expected outcome: Pipeline runs the tests successfully

Actual outcome: The pipeline fails requiring the maui-tizen dependency to be installed

I’ve included the Azure DevOps .yml pipeline in the reproduction project.

Link to public reproduction project repository

https://github.com/BurkusCat/DotNetTestTizen

Version with bug

6.0.400

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

N/A

Did you find any workaround?

I imagine installing the tizen workload would work around the issue, but the core of the issue is that we don’t want to do this, and we shouldn’t have an unnecessary dependency.

Relevant log output

2022-11-23T12:49:19.6544450Z ##[section]Starting: dotnet test
2022-11-23T12:49:19.6560250Z ==============================================================================
2022-11-23T12:49:19.6560590Z Task         : .NET Core
2022-11-23T12:49:19.6560940Z Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command
2022-11-23T12:49:19.6561300Z Version      : 2.210.0
2022-11-23T12:49:19.6561510Z Author       : Microsoft Corporation
2022-11-23T12:49:19.6562320Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
2022-11-23T12:49:19.6562770Z ==============================================================================
2022-11-23T12:49:20.7319420Z Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
2022-11-23T12:49:29.2949530Z [command]/Users/runner/hostedtoolcache/dotnet/dotnet test /Users/runner/work/1/s/DotNetTestTizen.UnitTests/DotNetTestTizen.UnitTests.csproj --logger trx --results-directory /Users/runner/work/_temp /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=/Users/runner/work/1/s/TestResults/Coverage/
2022-11-23T12:49:29.2950980Z 
2022-11-23T12:49:29.2951280Z Welcome to .NET 6.0!
2022-11-23T12:49:29.2951980Z ---------------------
2022-11-23T12:49:29.2952300Z SDK Version: 6.0.402
2022-11-23T12:49:29.2952430Z 
2022-11-23T12:49:29.2952800Z Telemetry
2022-11-23T12:49:29.2953110Z ---------
2022-11-23T12:49:29.2954120Z The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
2022-11-23T12:49:29.2954740Z 
2022-11-23T12:49:29.2955210Z Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
2022-11-23T12:49:29.2955480Z 
2022-11-23T12:49:29.2955780Z ----------------
2022-11-23T12:49:29.2956130Z Installed an ASP.NET Core HTTPS development certificate.
2022-11-23T12:49:29.2956750Z To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
2022-11-23T12:49:29.2957300Z Learn about HTTPS: https://aka.ms/dotnet-https
2022-11-23T12:49:29.2957700Z ----------------
2022-11-23T12:49:29.2958150Z Write your first app: https://aka.ms/dotnet-hello-world
2022-11-23T12:49:29.2958660Z Find out what's new: https://aka.ms/dotnet-whats-new
2022-11-23T12:49:29.2959170Z Explore documentation: https://aka.ms/dotnet-docs
2022-11-23T12:49:29.2959610Z Report issues and find source on GitHub: https://github.com/dotnet/core
2022-11-23T12:49:29.2960230Z Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
2022-11-23T12:49:29.2960880Z --------------------------------------------------------------------------------------
2022-11-23T12:49:29.2961340Z   Determining projects to restore...
2022-11-23T12:49:29.2962500Z /Users/runner/hostedtoolcache/dotnet/sdk/6.0.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: maui-tizen [/Users/runner/work/1/s/DotNetTestTizen.UnitTests/DotNetTestTizen.UnitTests.csproj]
2022-11-23T12:49:29.2963940Z /Users/runner/hostedtoolcache/dotnet/sdk/6.0.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/Users/runner/work/1/s/DotNetTestTizen.UnitTests/DotNetTestTizen.UnitTests.csproj]
2022-11-23T12:49:29.3004080Z ##[error]Error: The process '/Users/runner/hostedtoolcache/dotnet/dotnet' failed with exit code 1
2022-11-23T12:49:29.6324350Z ##[warning]No test result files were found.
2022-11-23T12:49:29.6327620Z ##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
2022-11-23T12:49:29.6332140Z Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
2022-11-23T12:49:29.6335910Z ##[error]Dotnet command failed with non-zero exit code on the following projects : /Users/runner/work/1/s/DotNetTestTizen.UnitTests/DotNetTestTizen.UnitTests.csproj
2022-11-23T12:49:29.6344760Z ##[section]Finishing: dotnet test

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:7
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rmarinhocommented, Apr 17, 2023

Like said by @BenBtg this is not related with Tizen, but just a manifestation that no maui workload is installed. In a CI scenario we have some pointers here on this blog post.

But basically one needs to install maui workload after setup the .net sdk.

I have opened a issue on the dotnet/sdk for a investigation and maybe a better exception.

Basically. the fix is just to add this to your yaml after installing .net version you want

   - task: Bash@3
      displayName: Install MAUI
      inputs:
        targetType: 'inline'
        script: |
          dotnet workload install maui  
0reactions
juwenscommented, Jan 26, 2023

second that problem, with update to vs 17.4.4 our build broke, with the described problem, despite we do not use tizen, nor do we have added it as TargetFramework

Read more comments on GitHub >

github_iconTop Results From Across the Web

`dotnet test` fails on a Maui project due to a dependency on ...
I want to run this command in a pipeline on a hosted DevOps agent however I get the same error on my local...
Read more >
"PROBLEM BUILDING DEPENDENCIES" error in pipeline ...
At work, we had issues with this type of error during a pipeline of a monorepo hosting several Elm projects: -- PROBLEM BUILDING...
Read more >
Managing step dependencies
If the step you're dependent on doesn't exist, the build will fail without running the step that is waiting for the dependency.
Read more >
Bitbucket pipeline sometimes fails on npm/yarn commands
Hello folks, I'm using bitbucket pipeline to build projects, but I'm struggling with an error I cannot reproduce all the time.
Read more >
Build stays in 'Running' forever for `depends_on
The thinking was that if some of its dependencies fail (or don't otherwise don't run), then the pipeline will register that after-trigger can ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found