How to install missing frame work

MUKISA JOHNMARY 20 Reputation points
2025-02-04T12:13:29.7866667+00:00

In the module name Create a web UI with ASP.NET Core all instructions say that the framework in use is .NET 8 however the project provided for the case study uses .NET 7 how can i change this project to use .NET 8. currecntly running the command dotnet watch leads to the following error.

User's image

User's image

This question is related to the following Learning Module

ASP.NET Core Training
ASP.NET Core Training
ASP.NET Core: A set of technologies in the .NET Framework for building web applications and XML web services.Training: Instruction to develop new skills.
32 questions
{count} votes

Accepted answer
  1. Pradeep M 6,010 Reputation points Microsoft Vendor
    2025-02-04T12:22:05.8333333+00:00

    Hi MUKISA JOHNMARY,

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

    Here the project targeting .NET 7, but you’d like to use .NET 8 instead. In this case, you have two options: 

    1.Install .NET 7: If you prefer to keep the project as it is, you can install the .NET 7 SDK from the official Microsoft website: 

    Download .NET 7 SDK 

    2.Upgrade the project to .NET 8: If you'd rather use .NET 8, follow these steps: 

    1.Update the Target Framework: 

    Open the .csproj file (likely named ContosoPizza.csproj) and look for this line: 

    <TargetFramework>net7.0</TargetFramework>
    
    

    Change it to: 

    <TargetFramework>net8.0</TargetFramework>
    
    
    

    2.Update NuGet Packages: 

    If there are any NuGet packages targeting .NET 7, you might need to update them. You can do this through the Visual Studio NuGet Package Manager or by running: 

    dotnet add package <PackageName> --version <LatestCompatibleVersion>
    
    

    3.Clear and Restore Dependencies: 

    Run these commands to ensure everything’s fresh: 

    dotnet clean
    dotnet restore
     
    

    4.Run the Project: 

    Now try running the project again

    dotnet watch
    

    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.  


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.