locked
Using V6.0 on Older version in VS 2017 RRS feed

  • Question

  • User438705957 posted

    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.

    Tuesday, October 2, 2018 5:48 AM

Answers

  • User753101303 posted

    Hi,

    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...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 2, 2018 12:44 PM

All replies

  • User753101303 posted

    Hi,

    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...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 2, 2018 12:44 PM
  • User438705957 posted

    Thanks PatriceSc,

    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.

    Thanks

    Tuesday, October 2, 2018 10:45 PM