ltrzesniewski / RazorBlade

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

Cannot use RazorBlade in a roslyn SourceGenerator, because it requires C# 10, and source generators need to target netstandard2.0 which only has c# 7.3 #7

Closed burropinolero closed 1 year ago

burropinolero commented 1 year ago

Please make it support netstandard too.

I created a fork, I will try to implement this myself, thanx.

ltrzesniewski commented 1 year ago

Maybe I should document this, but you can add the following to your source generator's csproj:

<PropertyGroup>
  <LangVersion>11.0</LangVersion>
</PropertyGroup>

And it will work. 🙂

I don't want to downgrade the whole library code to C# 7.3 TBH.

burropinolero commented 1 year ago

You're right, this works fine, thank you.