Hi JamesBoggs-4325,
This is a bug in which the example code provided does not reference the actual installed SDK in the sandbox. Others and I noticed this as well when going through the learn modules and opened pull requests via GitHub.
You'll need to edit global.json
and patient-records.csproj
. Feel free to use my pull request edit as a reference, but you'll want to set version in global.json
to 7.0.401
in this case. 7.0.400
would also work as in my code, since this will roll forward to the latest installed minor version of the SDK.
code ~/sas/global.json
{
"sdk": {
"version": "7.0.401",
"rollForward": "latestMinor"
}
}
You'll also need to set the target framework to netcoreapp7.0
in patient-records.csproj
. I also updated some other package reference versions in my case.
code ~/sas/patient-records.csproj
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp7.0</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>patientrecords</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.10.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.17.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.10" />
</ItemGroup>
</Project>
I wouldn't be surprised if this needs to be changed again once .NET 8 is out of preview and possibly installed in the MS Learn sandboxes, but this should run after you update the referenced SDK version and target framework.
If you are still facing any issue, please let us know in the comments. We are glad to help you.
If the information is helpful, please click on "Upvote" and "Accept Answer" so that it would be helpful to other community members.