It works well when I put the <InputSelect> in a <EditForm Model="@model">..</EditForm >and there’s no problem in your data binding.
Try to use below code to set <BlazorLinkOnBuild>false</BlazorLinkOnBuild> in the csproj file.
<PropertyGroup>
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
</PropertyGroup>
Refer to https://github.com/aspnet/AspNetCore/issues/7784
Update:
Use <select> tag instead of <InputSelect> like
<select @bind="model.ByCountryId">
@if (model?.Countries != null)
{
@foreach (var cnt in model.Countries)
{
<option value="@cnt.Id">@cnt.Name</option>
}
}
</select>