Open wattengard opened 3 weeks ago
Is there something I should look for to try to identify what triggers it?
The location of the errors in the generated C# code should hint where the error is in the razor file. You can also try commenting out pieces of the razor code until you figure out which line is the culprit.
We have fixed a couple of issues around @
and attributes in razor recently. Usually there were syntax errors in user code that the razor compiler incorrectly ignored. Some fixes also changed how pragmas (#
) behave - in general they are not supported in razor, so make sure you don't have any #region
, #pragma
s, etc.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.
Please see our Issue Management Policies for more information.
I am also getting this same issue after upgrading from dotnet core 6 to 8.
in my case its happening when i use component as tag helpers from some other project under the same solution.
in my case its happening when i use component as tag helpers from some other project under the same solution.
Can you share your source code or create a minimal reproducible example we could investigate?
I seem to be hitting the same issue as https://github.com/dotnet/razor/issues/10186 I am maintaining an old internal application so I was lifting it to latest .NET 8 (8.0.402 as of yesterday when I was trying this) and ran in to this error, it would not compile.
Works: 8.0.108 [C:\Program Files\dotnet\sdk] Throws: 8.0.400 [C:\Program Files\dotnet\sdk] Throws: 8.0.402 [C:\Program Files\dotnet\sdk] Throws: 9.0.100-rc.1.24452.12 [C:\Program Files\dotnet\sdk]
I had to go back to 8.0.108 to make it work again.
This also happens in VS2022, both latest regular (17.11.4) and latest preview. It works in VS also when I use global.json to force it to 8.0.108.
When opening the _MalInfo.cshtml file in Visual studio it doesn't show any errors in the editor itself. Syntax highlighting works properly etc. But the tooltip shows all errors in the compiler output if global.json sdk is set to one of the above with error.
It's not critical since I can get around it by using 8.0.108, but I wanted to report it anyway.
The software is proprietary so I'm not sure if I'm able to post the cshtml file itself, but I'll check into it? Is there something I should look for to try to identify what triggers it? The file itself uses both Microsoft taghelpers (asp-for et al) and my own taghelpers. But there should be nothing special in exactly this file that is not used other places in the solution.
Machine info: Windows 11, 23H2, 22631.4169