Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any risks involved in raising the language version number of a C# project?

Tags:

c#

I recently started a new job. They are using C# 5 back here, a pretty old language version, for multiple projects targeting .NET Framework 4.5.2. Multithreading is involved heavily here. I could not find any information about the impact of raising the language version of a *.csproj, so the title says it all. What changes are involved by raising the language version to, let's say, 7.3?

like image 632
PeteSabacker Avatar asked Nov 16 '22 18:11

PeteSabacker


1 Answers

The C# language is backwards compatible. You don't have to worry about that.

The CLR on the other hand does sometimes introduce changes (sometimes bugs) under the hood. And you might need to switch to a newer version when language features aren't supported on older Framework versions. This might affect your program in an unforeseen way. Testing is your friend here.

like image 90
Patrick Hofman Avatar answered Feb 06 '23 08:02

Patrick Hofman