0

Will the new syntax features of C# 7.0 be able to execute on .NET Framework 4.5?

Robin
  • 2,278
  • 3
  • 26
  • 46
  • 1
    Do you understand the difference between language features and runtime features? As long as a language feature doesn't require new runtime functionality, it is backwards compatible. – CodeCaster Mar 02 '17 at 14:13
  • As long as the compiler can generate code targeting the current .NET version it doesn't matter what features you add to the language. – dcg Mar 02 '17 at 14:14
  • 3
    I think it's a fair question if it's rephrased. Does C# 7 include any new features that will require a new framework version? AFAIK, the answer to that is 'no'. –  Mar 02 '17 at 14:19
  • 1
    @CodeCaster, I think it's a stretch to call this question a duplicate. If you already know the answer, that doesn't make it a duplicate. C# 7.0 isn't out yet. Do you know for sure at this moment that it doesn't require a .NET Framework upgrade? If so, why not just answer the question? – Robin Mar 02 '17 at 20:38
  • _"C# 7.0 isn't out yet"_ - so we don't know which features are going to make it, so we can't answer this question. Like I said, the principle remains the same. If you can read [ask] and give your question somewhat more body, and C# 7 is close to release, I'll happily vote to reopen. Up till then, I stand by my previous comment: the same principle as with C# 6 applies. Anyway as far as I can find, the currently proposed extensions are mere syntactic sugar, so it compiles to IL already supported by older runtimes. – CodeCaster Mar 02 '17 at 21:23
  • 1
    @CodeCaster, C# 7.0 will be out in 5 days on Tuesday, March 7th. Given the effort required to release a new version of Visual Studio, I imagine there are a lot of people who know the answer to this question. It seems reasonable that they be encouraged to share their knowledge by answering this question. – Robin Mar 02 '17 at 21:41
  • 2
    Google personalizes search results, so if the OP searches for the title it might not actually bring back useful results. I've noted this effect while using my tablet, which isn't associated to my google account. Its very difficult to find good results on my tablet. –  Mar 02 '17 at 21:59
  • 1
    Aren't the new tuples a runtime-dependant feature? – Kenneth K. Mar 02 '17 at 22:02
  • 1
    @KennethK. The new tuples can be gotten through a Nuget package. They don't require runtime support. IIRC the package is called "ValueTuple" –  Mar 02 '17 at 22:06
  • 1
    @Amy According to https://blogs.msdn.microsoft.com/dotnet/2016/08/24/whats-new-in-csharp-7-0/, it looks like the types are "pre-release", which seems to me like they could be integrated into the Framework during RC. – Kenneth K. Mar 02 '17 at 22:14
  • 1
    @Servy, I searched for quite a while before asking the question. Believe me, I would rather find the answer on my own than waste time here in the comments trying to get my question to be taken seriously. Obviously, CodeCaster didn't find it either, so it was hard to find. Also, I would appreciate it if the down voter explained their reasoning. CodeCaster, Amy and I had no idea it was an exact duplicate. – Robin Mar 03 '17 at 12:01
  • 1
    @Amy, thank you for taking the question seriously. I really appreciate it. – Robin Mar 03 '17 at 12:01
  • @Robin Like I said, I literally put your question title (copy and pasted directly from this question) into google and it was right at the top of the list. CodeCaster said himself that he only didn't search because he expected that you would have. Note that Amy didn't say that she couldn't find a duplicate, she just said that she thought it was a good question, despite not looking for any duplicates. – Servy Mar 03 '17 at 14:09

0 Answers0