It's quite easy to miss, but you need to ensure that your Client project is declared like this:
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<TargetFramework>net6.0</TargetFramework>
<!--The rest of your code here-->
</Project>
Notice that Microsoft.NET.Sdk.Web was changed to Microsoft.NET.Sdk.BlazorWebAssembly.
It's also important to have Microsoft.AspNetCore.Components.WebAssembly up to date.
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.4" PrivateAssets="all" />
</ItemGroup>
A diff tool like WinMerge is really helpful when looking for differences like this.
Note:
There's a good chance that you'll run into some other issue (most likely hot reload related) while making such an upgrade. Until Microsoft comes up with a super clean solution to this, your best bet is to create a new .NET 6 project and move your code files there. This might of course be a frustrating option, but it's will save you so much more time.