I know this is a pretty old problem, but maybe it will help someone. If you use C # razor in Asp.Net Core 2+, if you have this problem.
1) Copy the contents of the file to notepad.
2) Delete the .cshtml file.
3) Create a .cshtml file with the same name.
4) Copy content from notepad to a new file
I donβt know if this is just a strange mistake or a consequence of updating the project from Core 1.0 to 2+, but this FULLY solved the problem for me. This was a problem for me both in Visual Studio 2017 and in 2019.
Greg F. Apr 26 '19 at 22:23 2019-04-26 22:23
source share