dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
502 stars 193 forks source link

*@@* characters in razor view stop code generation without providing source file name #7421

Open kobruleht opened 2 years ago

kobruleht commented 2 years ago

Describe the bug

If Razor view contains *@@* characters (without space between *@ and @*), razor views are not added to output. Warning message does not contain view file name caused the issue.

To Reproduce

Create ASP.NET 6 MVC application. Add Razor view:

@if (true)
{
    using (Html.BeginForm("TooteParing", "Store", new
    {
    },
            FormMethod.Post, false,
            new
            {
                @class = ""
@*                @class = ""
*@@*                @class = ""
*@            }))
    {
    }
}

Re-build application and publish it.

Observed:

Output window contains message:

3>CSC : warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'startCommentStar'

No view name caused error is provided in message and in output window even if Message level is set to Diagnostics in Visual Studio Build options.

Published application does not find views inside it.

dotnet --info Output ``` .NET SDK (reflecting any global.json): Version: 6.0.100 Commit: 9e8b04bbff Runtime Environment: OS Name: Windows OS Version: 10.0.19043 OS Platform: Windows RID: win10-x64 Base Path: c:\program files\dotnet\sdk\6.0.100\ Host (useful for support): Version: 6.0.0 Commit: 4822e3c3aa .NET SDKs installed: 1.0.0-preview2-003121 [c:\program files\dotnet\sdk] 1.0.0-preview2-003131 [c:\program files\dotnet\sdk] 3.1.415 [c:\program files\dotnet\sdk] 5.0.101 [c:\program files\dotnet\sdk] 5.0.104 [c:\program files\dotnet\sdk] 5.0.201 [c:\program files\dotnet\sdk] 5.0.209 [c:\program files\dotnet\sdk] 5.0.302 [c:\program files\dotnet\sdk] 5.0.303 [c:\program files\dotnet\sdk] 5.0.401 [c:\program files\dotnet\sdk] 5.0.403 [c:\program files\dotnet\sdk] 6.0.100 [c:\program files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.30 [c:\program files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.30 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.13 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.14 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.15 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.17 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.19 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.21 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.1 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.4 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.6 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.8 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.9 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.10 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.12 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.0 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.0 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.0.1 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.26 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.30 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.13 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.14 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.15 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.17 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.19 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.21 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.1 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.4 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.6 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.8 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.9 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.10 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.12 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0 [c:\program files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.13 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.14 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.15 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.17 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.19 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.21 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.1 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.4 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.6 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.8 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.9 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.10 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.12 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.0 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download ```
ghost commented 2 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.