Sergio0694 / PolySharp

PolySharp provides generated, source-only polyfills for C# language features, to easily use all runtime-agnostic features downlevel. Add a reference, set your C# version to latest and have fun! 🚀
MIT License
1.77k stars 46 forks source link

How to use it quickly #66

Closed wz172 closed 1 year ago

wz172 commented 1 year ago

I reference this package in netframework4.8, but how do I change the language version, by adding a [Directory.Build.props] file?

Sergio0694 commented 1 year ago

"by adding a [Directory.Build.props] file?"

If you want to use a shared .props file, just add this in a PropertyGroup in there:

<LangVersion>11.0</LangVersion>

And that's it 🙂

Note: you don't have to set 11.0, you can use whatever version you prefer, 11 is just the latest one.