Last post Oct 02, 2018 10:45 PM by Madog
Oct 02, 2018 05:48 AM|Madog|LINK
I have recently upgraded to VS 2017.
I built a replica version of one of my Production websites which was built in VS 2013 targeting framework version 3.5.
When creating the project in VS 2017, I set the target framework version to 3.5 on the very first page.
I am now hoping to utilise some of the C# language features from C# 6.0.
There doesn't seem to be a way thru property pages or other to set the version of C#.
I know there is an advanced button on the properties page if the project is targeted to 4.6.x on creation, but that button doesn't exist in VS 2017 when targeting 3.5 on creation.
Oct 02, 2018 12:44 PM|PatriceSc|LINK
What happens if you change the language version and then go back to 3.5 ? If I remember you often have most language features working on the old CLR but a couple that requires the new runtime. My guess is that MS don't want to explicitely allow this even
thought it should work for most features...
It seems to even sort of work with C#7 according to https://stackoverflow.com/questions/42672957/c-sharp-7-net-clr-visual-studio-version-requirements/42675053#42675053 but
it seems you need aditional packages etc...
My personal preference in the same situation would be to invest my time into upgrading the .NET version...
Oct 02, 2018 10:45 PM|Madog|LINK
I targeted 3.5 on creation because I could quickly have a Development version of my Production environment setup quickly.
I particularly like the string interpolation and expression bodied member features introduced in C# 6.0
Yes, I think you are right in avoiding the turmoil of trying to retrofit C#6 into a 3.5 app. It's not worth the headache.
I'll take your advice and just upgrade the entire app.