ltrzesniewski / RazorBlade

Compile Razor templates at build-time without a dependency on ASP.NET.
MIT License
149 stars 7 forks source link

DiagnosticId is not available in netstandard2.0 #5

Closed cabralRodrigo closed 1 year ago

cabralRodrigo commented 1 year ago

When the library is used with a netstandard2.0 project the generated code from the cshtml files cannot be built as the property DiagnosticId of the Obsolete attribute was introduced in net5.

The build log:

Build started...
1>------ Build started: Project: ***********.csproj, Configuration: Debug Any CPU ------
1>C:\****************\RazorBlade.Analyzers\RazorBlade.Analyzers.RazorBladeSourceGenerator\************.RazorBlade.g.cs(17,95,17,107): error CS0246: The type or namespace name 'DiagnosticId' could not be found (are you missing a using directive or an assembly reference?)
1>C:\****************\RazorBlade.Analyzers\RazorBlade.Analyzers.RazorBladeSourceGenerator\************.RazorBlade.g.cs(23,95,23,107): error CS0246: The type or namespace name 'DiagnosticId' could not be found (are you missing a using directive or an assembly reference?)
1>Done building project "***********.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Elapsed 00:00,453 ==========
ltrzesniewski commented 1 year ago

Oops, thanks for reporting the issue.

ltrzesniewski commented 1 year ago

Fixed in v0.4.2