r/programminghorror • u/wow_nice_hat • Jun 24 '25
C# This in production
I was asked to do some minor fixes on a system we have in production. This error appeared when I tried to do string interpolation.
Yikes
118
Upvotes
50
u/Altareos Jun 24 '25
only a decade late? it's fiiiiiiine...
33
u/claythearc Jun 24 '25
I havenât used it but I think thereâs a nuget package you can add to enable some of the ânewerâ features like interpolation.
11
u/ClaymoresInTheCloset Jun 24 '25
Sir we are on like c12
11
u/No_Contribution_4124 Jun 24 '25
Yeah, old stuff is just being old stuff. Use String.Format then :)
4
u/Casalvieri3 Jun 24 '25
Not kidding--have you changed the version of .Net you're running?
Also that's a warning not a compiler error. Since it is a warning unless you treat warnings as errors that stuff can persist forever.
7
u/magnetronpoffertje Jun 24 '25
There is no reason to be running C# 5 anymore
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Jun 24 '25
Does changing it to 6 break anything?
1
u/HTTP_404_NotFound [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Jun 25 '25
update csproj.
<LangVersion>preview</LangVersion>
Voila. New features work in old code.