Compartir a través de


.Net Framework 4.6.2 not in Visual Studio 2017

Cannot find the .NET Framework 4.6.2 in Visual Studio 2017?  Without it you cannot get all the cool new C# features?

When you create a new project for example, you may only see .NET Framework versions up to 4.6.1 as seen in Figure 1.

image

Figure 1, where is 4.6.2 in Visual Studio 2017

This is easily resolved by installing the .NET Framework 4.6.2 Developer Pack from herehttps://www.microsoft.com/net/targeting

Once installed you will see the desired version and you can use all those new C# 7 features, rock!  See Figure 2 which I have after installing the .NET Framework 4.6.2 Developer Pack.

image

Figure 2, where is 4.6.2 in Visual Studio 2017, download and install 4.6.2

I am certain this will be included in an up and coming update, until, just manually install it.

I was also getting "Predefined type 'System.ValueTuple'2' is not defined or imported" when I was working with the new C# 7 Tuple feature, like Figure 3.

tuple001

Figure 3, C# 7 tuple, System.ValueTuple is not defined or imported

I fixed this by manually installing the System.ValueTuple NuGet package, Figure 4.

tuple002

Figure 4, C# 7 tuple, System.ValueTuple is not defined or imported

Comments

  • Anonymous
    March 23, 2017
    The comment has been removed
  • Anonymous
    March 23, 2017
    This should have been selected by default
    • Anonymous
      July 23, 2017
      I agree with Blake. This probably should have been selected by default.
  • Anonymous
    March 23, 2017
    in setup, simply select .net 4.6.2. Because .net standard 2.0 will use 4.6.1, 4.6.2 is not enabled by default, only 4.6.1
  • Anonymous
    March 23, 2017
    The comment has been removed
    • Anonymous
      March 27, 2017
      Windows 10 1607 is also "RTM".If you develop for Windows you should be using the last version of Windows (July 2016) and not an old version from late 2015 (We are in 2017 !)
      • Anonymous
        May 25, 2017
        Unless you maintain software for customers who won't upgrade and are still running Win7
  • Anonymous
    July 26, 2017
    Most C# 7.0 features are I think available in VS2017 with the default 4.6.1 .Net framework: the very nice out variables, pattern matching, local functions, output refs and arrows for constructors and all seem to work fine. In fact since these are compiler constructs in Visual Studio 2017 you can use them with any earlier version of the framework if you upgrade to VS2017. I think the ONLY thing from that list of new features that doesn't work is tuples and the associated deconstruction stuff, and support for these can be installed via a NuGet package (search for System.ValueTuple). This works in earlier versions of the framework too. So I don't think you really need to use a later framework version just to get these features.
  • Anonymous
    August 29, 2017
    If you install .Net 4.7, you will also encounter the same problem. At this time you must first remove .Net 4.7 to install .Net 4.6.2.
  • Anonymous
    November 30, 2017
    In my case when i downloaded the 4.6.2 developer pack and tried installing it . it showed me the repair /uninstall dialog. once i did repair all worked fine !