In Visual Studio, created the Blazor WebAssembly App.

In Program.cs file, added the code which you have mentioned.
builder.Services.AddMsalAuthentication(options =>
{
builder.Configuration.Bind("AzureAd", options.ProviderOptions.Authentication);
});
Initially even I got the same error.

In BlazorApp1.Server Application, Installed the Microsoft.Authentication.WebAssembly.Msal NuGet Package.
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="7.0.2" />
- Now I am able to build the application without any issues.
My BlazorApp1.Server .csproj file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>BlazorApp1.Server-****</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.0" />
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="7.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Client\BlazorApp1.Client.csproj" />
<ProjectReference Include="..\Shared\BlazorApp1.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0" />
</ItemGroup>
</Project>
My Folder Structure:

- As there are two
Program.cs files (Client/Server), make sure you have installed the package in the application where you are adding the code.
Program.cswithout any issues. Make sure you have installed the package in the same ( Client/Server) Application..csprojfile.