Closed klemmchr closed 4 years ago
What helped in my case was to explicitly switch to C# 8 by adding <LangVersion>8.0</LangVersion>
to some PropertyGroup
in the .csproj
files. Hope this helps!
I'm targeting netcoreapp3.1
and have set LangVersion
to latest
so I have C# 8 available. Does it make a difference when I specify 8.0
explicitly?
@chris579 latest depends on your SDK, not your targeting pack.
In this case it would be worth mentioning this somewhere in the FAQ in the README. Seems to be a pitfall users might run into.
@chris579 Please submit a PR for what you have in mind and I'll review it.
@jzabroski Thanks for this solution, I was also having this problem and spent like 3 hours trying to fix it and was literally about to submit an issue before GitHub referred me to this issue.
Describe the bug When compiling a template I get the following errors
Which translates to
The feature "Nullable reference type" is not available in C# 7.3. Use Version 8.0 or higher.
I'm not using nullable reference types anywhere in my model or template. My template isn't even 38 lines long.To Reproduce
netcoreapp3.1
.netcoreapp3.1
.RazorLight
into the classlib and reference it from the main project.IRazorLightEngine
to the DI via an extension method that is placed in the classlibConfigureServices
Expected behavior The template compiles without errors.
Information (please complete the following information):