Request update Sample project to Support .NET 8

Yejiang Gong 20 Reputation points Microsoft Employee
2024-11-14T10:01:11.28+00:00

I was following the training provided in the module Run Quality Tests in a Build Pipeline, but encountered an issue when installing dotnet-reportgenerator-globaltool 5.4.1. The Azure DevOps pipelines throw an error indicating that the tool only supports .NET 8 or 9. It seems that the sample project needs to be updated, which can be found here: mslearn-tailspin-spacegame-web.

Here is the error message for reference:

/tmp/1267006b-aa44-4055-abd9-0075c341e422/restore.csproj : error NU1202: Package dotnet-reportgenerator-globaltool 5.4.1 is not compatible with net6.0 (.NETCoreApp,Version=v6.0) / any. Package dotnet-reportgenerator-globaltool 5.4.1 supports:
/tmp/1267006b-aa44-4055-abd9-0075c341e422/restore.csproj : error NU1202: - net8.0 (.NETCoreApp,Version=v8.0) / any
/tmp/1267006b-aa44-4055-abd9-0075c341e422/restore.csproj : error NU1202: - net9.0 (.NETCoreApp,Version=v9.0) / any

This question is related to the following Learning Module

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,830 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pradeep M 4,320 Reputation points Microsoft Vendor
    2024-11-14T10:40:38.99+00:00

    Hi Yejiang Gong,

    Thank you for reaching out to Microsoft Q & A forum.  

    This module was originally designed to use .NET SDK 6.0, meaning that the instructions and configurations are optimized for that version. However, due to recent tool updates, some packages, such as dotnet-reportgenerator-globaltool, only support .NET 8.0 or higher. 

    To complete the exercises smoothly, we recommend the following options: 

    Use .NET SDK 8.0: The latest versions of tools like ReportGenerator are only compatible with .NET 8.0. We suggest installing .NET SDK 8.0 and updating your project settings accordingly. You can download .NET SDK 8.0 from Microsoft's .NET downloads page. 

    1.Update the SDK version: Open the project’s .csproj file and set the target framework to net8.0: 

    <TargetFramework>net8.0</TargetFramework>
    
    

    2.Adjust your pipeline: Update the Azure Pipelines YAML file to target .NET 8.0 by specifying dotnetSdkVersion: '8.x' in the UseDotNet@2 task: 

    variables:
      dotnetSdkVersion: '8.x'
    
    

    3.Check and update dependencies: Ensure that any dependencies, such as coverlet.msbuild and ReportGenerator, are compatible with .NET 8.0 by updating them to the latest versions. 

    4.Test the setup: After making these changes, run tests to confirm that code coverage reports and other functions perform correctly with .NET 8.0. 

    Note for Future Updates:  This module may be updated to include support for newer SDKs in the future. For now, using .NET SDK 8.0 will allow you to complete the exercises without compatibility issues. 

    Please feel free to contact us if you have any additional questions.    

    If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.         

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.