Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Why am I getting this Razor Type error in my Blazor Server Project?

$
0
0

The razor code has some red lines and if I hover over them they show completely unrelated error messages to what the actual error is. The actual error seems to be a namespace conflict, because if I fully qualify the input to AntDesign.Input, the errors disappear. I suspect it is some Microsoft.AspNetCore.Components namespace in the imports file that is conflicting. Also, if I don't fully qualify it and I hover over the input it does actually show the correct namespace, which makes this make even less sense.

The bigger problem is that I don't get useful error messages so I just spent a really long time trying to figure this out. The error messages include 'Encountered end tag "Form" with no matching start tag. Are your start/end tags properly balanced?', 'Encountered end tag "FormItem" with no matching start tag. Are your start/end tags properly balanced?', 'The "Form" element was not closed. All elements must be either self-closing or have a matching end tag.', 'Found markup element with unexpected name 'Prefix'. If this is intended to be a component, add a @using directive for its namespace.'.

So my questions are:

  1. Why am I not getting useful error messages?
  2. Why did the hover context menu give the correct namespace but it actually seems to not use that namespace?
  3. Is this a common problem or might there be something wrong with my visual studio settings?
  4. Can you give me an in depth explanation of why the error occurs?

Screenshots:Working and non working codeUseless error listHover context menu with correct namespace detection


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>