I knew this, but I had a brain fart here and couldn’t figure out what was wrong. I was trying to output some simple text to the browser based on some condition:
I started to get the following error message:
The type or namespace name 'Do' could not be found (are you missing a using directive or an assembly reference?)
Along with a list of others:
But nothing really said what was wrong.
Nothing’s really wrong, per se, but Razor can’t figure out what I want to do here and doesn’t know that Do should be text and not me trying to code something. To fix it, simply wrap the text in a <span> tag and roll:
The only reason I ran into this was because I copy & pasted the text. Normally you’d get IntelliSense as soon as you start typing and that should throw up a context flag pretty quick.