This article explains how to install and use .NET Framework 4.7, .NET Framework 4.7.1, & .NET Core 2.0, and troubleshooting if you are getting an exception while installing these latest components. This article also explains how to use the different versions of C#, e.g. C# 7, C# 7.1, C# 7.2 with Visual Studio 2017 and installing multiple instances of Visual Studio 2017 side by side.
I am going to cover these points in this article.
- Installing .NET Framework 4.7
- Troubleshooting for the error you might get while installing .NET Framework 4.7
- Installing .NET Core 2.0
- Installing .NET Framework 4.7.1
- Troubleshooting for error occurred while installing .NET Framework 4.7.1
- How to install .NET Framework 4.7.1 using windows Insider.
- Installing and switching between different versions of C# 7.x.
- Installing Visual Studio 2017 “15.3” & Visual Studio 2017 Preview “15.4 preview 4” side by side.
Installing .NET Framework 4.7
I am going to install the .NET Framework 4.7 for Visual Studio 2015 & 2017. Let me explain the process and troubleshooting steps one by one.
If you do not have Visual Studio 2017 already installed on your machine, then you can go to the Microsoft official download link for Visual Studio 2017 and install it from there. Since it gets installed successfully, you do not need to worry about troubleshooting. Just make sure to choose all the required components during installation.
However, if you have Visual Studio 2017 already installed and you just want to install .NET Framework 4.7 but you are unable to install it due to any reason, then please go through the below steps.
Step 1 - Open Visual Studio 2017 and check for the latest framework installed
Open Visual Studio 2017 and open the template for creating a console application. Here, you should notice that it is showing I can choose .NET Framework 4.6.2 as the latest version. However, just below the .NET Framework 4.6.2, there is an option to look for more frameworks.
Step 2 - Search for more Frameworks
Click on the link to search for more Frameworks. It opens a web page -- navigate to the page from where you can download .NET framework 4.7. You'll find that there are 3 options for downloading and installing the .NET framework 4.7. Following is a screenshot from the same link:
As you can see, it is showing you 3 options -
- Web installer
- Offline installer
- Windows Update
Step 3 - Download and run installer
- Download and run Web Installer
First of all, try with Web Installer. Download the Web Installer and run the downloaded executable file. If it gets installed without any error, then it is okay.
However, if it does not get installed for your Visual Studio 2017, you will see a warning message, as displayed in the following screenshot.
Then, have patience and be with me. I am going to explain why it is showing this message. However, if you are getting any other message or exception, then I recommend you to update your Visual Studio 2017 first and then retry for the same.
- Download and run Offline Installer
Now, try with the Offline Installer. You may get the same message.
- Download Windows Update
Download Windows Update and install it, but still, you may get the same message.
Step 4 - Check for the latest .NET Framework installed on your computer
So here, you find an ambiguity as you can see that the installer is saying that .NET Framework 4.7 has been installed already whereas Visual Studio 2017 is showing the latest .NET Framework as .NET Framework 4.6.2. So, you must be thinking which one is correct. For that, you have to check the latest version installed on your machine.
Step 5 - Checking the Latest .NET Version Installed on Your machine
There are multiple options to check for the latest version installed on your machine. You can check with Visual Studio but it is not the correct version, so you can check with installed files and registry and other configuration options. I would recommend that rather than going through those options, we can check it with a simple console application as well.
Open a console application and run the following code.
- using Microsoft.Win32;
- using static Microsoft.Win32.RegistryHive;
- using static Microsoft.Win32.RegistryKey;
- using static System.Console;
-
- namespace CheckFrameworkVersion
- {
- class Program
- {
- static void Main(string[] args)
- {
- using (RegistryKey key = OpenRemoteBaseKey(LocalMachine, "").OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP\"))
- {
- foreach (string version in key.GetSubKeyNames())
- {
- if (version.StartsWith("v"))
- {
- RegistryKey versionKey = key.OpenSubKey(version);
-
- if ((string)versionKey.GetValue("Version", "") == "")
- {
- foreach (string subKey in versionKey.GetSubKeyNames())
- {
- WriteLine($" {subKey} {versionKey.OpenSubKey(subKey).GetValue("Version", "")}");
- }
- }
-
- }
- }
- }
- }
- }
- }
Console Output
As you can see, it shows that .NET Framework 4.7 has installed already. However, I am not able to see it in Visual Studio 2017. I am already using the latest version of Visual Studio 2017, so there should not be any reason to update it.
Step 6 Install the latest Framework using Visual Studio installer.
Open Control panel and go installed programs è select Visual Studio 2017 and click on modify to open Visual Studio installer. There are other options as well to open the Visual Studio installer.
You can see in the preceding screenshot that there is an option to select/deselect components.
Please select the options -
- .NET Framework 4.6.2 development tools
- .NET Framework 4.7 development tools
You can select only .NET Framework 4.7 but I am selecting both so that I can use both of them interchangeably.
Once installation gets completed, please open Visual Studio 2017 and check for the .NET Framework in the drop-down list, as shown in the below screenshot.
So, you can see in the screenshot that .NET Framework 4.7 has installed and available for use in Visual Studio 2017. If your machine has Visual Studio 2015 & Visual Studio 2013 as well, then Microsoft.NET Framework 4.7 gets installed for those versions as well.
So finally, .NET Framework 4.7 has installed for Visual Studio 2013, 2015, & 2017.
Installing .NET Core 2.0
Now, I am going to install .NET Core 2.0.
- Open Visual Studio 2017 (version 15.3.5 or later) => File => New Project => Web => ASP.NET Core Web Application.
- Select .NET Framework 4.7 & ASP.NET Core Web Application, as shown in the following screenshot.
- Click on the OK button.
- It opens a new window where you can choose different versions of ASP.NET Core.
As you can see in the above screenshot, there are two versions of ASP.NET Core are available.
- NET Core 1.0 and
- NET Core 1.1
Though ASP.NET Core 2.0 is not available in the dropdown list. You can see in the screenshot that there is an option for downloading .NET Core 2.0. Click on the download link to download it.
It redirects you to a new webpage. Following is a screenshot for the same.
Click on the link provided after “Install .NET Core 2.0” as shown in the preceding screenshot. It redirects to a new link.
- Click on the button “Download .NET Core SDK”. It downloads the .NET Core SDK 2.0. Once the download is completed, please run the downloaded executable file.
It opens a new window to start the installation and takes 2-5 minutes to complete the installation.
Restart the Visual Studio 2017.
Once Visual Studio restarts, you can use ASP.NET Core 2.0. You may have noticed that ASP.NET Core 2.0 has more templates as compared to ASP.NET Core 1.1. Following is a screenshot for the same.
Installing .NET Framework 4.7.1
Now, I am going to install the .NET Framework 4.7.1.
You can not install .NET Framework 4.7.1 using the same process which you followed for installing .NET framework 4.7. As .NET Framework 4.7.1 has not been officially announced and you can install it only through the early access program.
Visit the
link and find an option for downloading .NET Framework 4.7.1. Download and install it.
You may get an error while installing it as displayed in the following screenshot.
So if anything is pending for installation, then you need to restart your machine and try to re-install it.
I restarted the machine and started the installation again, but this time I am getting a different exception.
As you can see in the screenshot, it is saying that “Microsoft .NET Framework 4.7.1 Preview Developer Pack is not supported on this operating system”.
I went through the installation instruction and tried to update my Operating System. However, it does not work for me. I am already using the latest version of Windows 10 enterprise.
Then, I tried enabling developer mode and updating OS and then re-installing it again. However, still, I am getting the same issue.
So, it seems that Windows Insider is the only option for me through which I can install .NET Framework 4.7.1 for Visual Studio 2017. However, if you do not want to do more experiments, then I suggest not to install it. Because it may not be stable, so it is highly recommended that please go with installation only if you want to do something with the experimental version.
Please go through the terms & conditions of using Windows insider and only continue if you agree. Because after getting the Windows Insider update, your machine may become unstable. Please proceed further at your own risk.
Follow the instructions to install Windows Insider. Please make sure that you have installed all the updates related to windows.
Once installation gets completed for Windows, you can retry to install .NET Framework 4.7.1.
Now, open Visual Studio 2017 and Check if .NET Framework 4.7.1 is available for use.
Installing Visual Studio 2017 preview “15.4 Preview” along with Visual Studio 2017
If you would like to use some new features of Visual Studio 2017 which are not yet officially announced but available for use with the preview version then you can install Visual Studio 2017 Preview version alongside Visual Studio 2017.
Go to the official link of “Early access to Visual Studio”.
Click on the download link to download. Download and install any edition as per your choice. Right now I am going to download the enterprise edition and install it.
It opens similar installation windows like that of Visual Studio 2017.
You can see in the following screenshot that it is showing 2 different versions of Visual Studio 2017 being installed side by side.
Using different versions of C# with Visual Studio 2017
As I have already installed all the latest components of Visual Studio 2017 I do not need to install any other component for using the latest version of C#.
Step 1
Open Visual Studio 2017 and create a console application
Step 2
Right-click on the project which you have created as a console app and open the properties window.
Step 3
Go to the Build tab
Step 4
Click on the “Advanced…” button. It opens “Advanced Build Settings” where you find options for all the available versions of C#.
For detailed step-by-step instructions along with pictorial representation you can go through my other article:
If we talk about C# 7, there are 4 different options which we can choose.
- C# 7.0
- C# 7.1
- C # latest major version (default) and
- C# latest minor version (latest)
If you are looking for the option to use C# 7 & C# 7.1 with Visual Studio Code Editor, then please go through the below-provided links.
You can visit my other articles as well which are related to C# 7, .NET Core, and Visual Studio 2017.