“The attribute names could not be inferred from bind attribute ‘bind-value'” error in Blazor

It turns out there are at least two causes of this:

1. The component name is now case-sensitive

The answer turns out to be that naming of blazor components is now case-sensitive, and I was missing a capital letter in ‘TelerikDropdownList’ which should be TelerikDropDownList.

The change to use case-sensitive names is documented here and is also discussed here and in the official documentation here. The idea was to reduce misleading messages, but it’s had the consequence of introducing another one, so I’ve raised an issue for that on the AspNetCore repo.

2. You’ve forgotten the @using statement for the component’s namespace

You’ll also get the same error if you’ve forgotten or removed the @using statement for the component’s namespace. That’s very easy to do if you’re using ReSharper as it is currently flagging them as unused and offering to remove them.

Checking if this is the issue

A good way to check if the compiler has correctly identified your component as a Blazor component rather than a HTML tag is to check the colour coding of the keywords. They will be the same colour if things are working correctly (green in the example below):

enter image description here

Whereas if the name or namespace are wrong you’ll see a mix of colours (note that Data and ValueField are now a different colour to TelerikDropdownList):

enter image description here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)