Blazor cannot find variables in related C# class file

96 views Asked by At

I have upgraded my Blazor project from .NET 6 to .NET 8. After I have the issue, that my Blazor componennt cannot see the variables stored in related CS file: enter image description here

But it is in the related CS file: enter image description here

If I remove the partial keyword from class definition, it immediately writing error that partial keyword is missing. If I create the variables directly into razor files @code{} block, it immediately writes the variables already defined: enter image description here

Did any if you already met such issue?

Thanks! G

1

There are 1 answers

0
Mayur Ekbote On

Put @ before _email. It should work. If it doesn't then join the club :) VS 2022 on Blazor is full of idiosyncrasies like this. Check out the issue I have raised on GitHub:

https://github.com/dotnet/razor/issues/9696