.net version mismatch

Avinash Arora 0 Reputation points
2024-09-19T01:31:32.87+00:00

Hi, There is mismatch in .net version in sandbox provided. dotnet run command is giving error and we can not proceed in the exercise. please help to resolve it.

training link "https://video2.skills-academy.com/en-us/training/modules/control-access-to-azure-storage-with-sas/5-use-stored-access-policies"

error log:

App: /home/avinash/sas/bin/Debug/net7.0/patient-records

Architecture: x64

Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64)

.NET location: /usr/share/dotnet

The following frameworks were found:

  8.0.8 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Learn more:

https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:

https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.0&arch=x64&rid=linux-x64&os=mariner.2.0

avinash [ ~/sas ]$ 

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,524 questions
{count} votes

Accepted answer
  1. Pradeep M 2,450 Reputation points Microsoft Vendor
    2024-09-19T04:58:36.18+00:00

    Hi Avinash Arora

    I understand you're facing a .NET version mismatch in the Azure sandbox. Here’s how to resolve it:   

    If you can't install .NET 7.0, change your project to target .NET 8.0: 

    1.Access Cloud Shell: 

    Open Azure Sandbox 

    Launch Cloud Shell. 

    2.Navigate to Your Project: 

    cd ~/sas  # Adjust as needed
    
    
    

    3.Open the .csproj File: 

    code *.csproj
    
    
    

    4.Update the <TargetFramework>: Change this line: 

    <TargetFramework>net7.0</TargetFramework>
    
    

    to: 

    <TargetFramework>net8.0</TargetFramework>
    
    

    6.Save the Changes:After making the modification, save the file by pressing Ctrl + S or using the file menu. 

     7.Rebuild and run your app: 

    dotnet build
    dotnet run
    
    

    If these steps are helpful, please click "Upvote" and "Accept Answer" on this post. 

    If you continue to experience issues, please provide screenshots or additional details in the comments, and we will be happy to assist further. 

    Thank you. 

    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.