Fix .NET Version in Azure Cloud Shell#12
Open
huihui0310tt wants to merge 1 commit into
Open
Conversation
The cloud shell is not compatible with this framework version. To resolve this issue, update the .NET version to 7.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[last edit: Aug. 29, 2023]
The Cloud Shell is not compatible with this framework version. To resolve this issue, update the .NET version to 7.0.
Environment: Azure Cloud Shell
Reproduce error environment:
Upload a .NET webpage to the WebApp.
git clone https://github.com/MicrosoftDocs/mslearn-hotel-reservation-system.gitcd mslearn-hotel-reservation-system/srcdotnet buildcd HotelReservationSystemdotnet publish -o websitecd websitezip website.zip *az webapp deployment source config-zip --src website.zip --name <your-webapp-name> --resource-group <your-rg-name>Configure WebApp URL.
cd ~/mslearn-hotel-reservation-system/src/HotelReservationSystemTestClientcode App.config### Continue Setting Configuration for WebApp url ###Based on the hint in Microsoft Learn and the issue in this repository, change the .NET version to 6.0.
code HotelReservationSystemTestClient.csproj### Setting TargetFramework from netcoreapp2.1 to netcoreapp6.0 ###After running
dotnet buildanddotnet run, you may receive the following error log:Solution:
Install .Net 7
Reference: dotnet-install
Install Package
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.shchmod +x ./dotnet-install.sh./dotnet-install.sh --channel 7.0Change the .NET version to 7.0.
code HotelReservationSystemTestClient.csproj### Setting TargetFramework from netcoreapp6.0 to netcoreapp7.0 ###After installing .NET 7, you can continue to perform flow tests.
dotnet builddotnet run