Being a software developer for many years means you have watched the tools you work with change over time. This is usually a rewarding change because it means that those tools got better or they were replaced by something better. There are those of us who still have to maintain older projects using older frameworks and as time moves on it becomes hard to do this.
I recently had to setup a new work machine from scratch and stumbled across a curious problem that luckily had a simple and elegant solution.
Gotcha
dot net framework 4.0 and 4.5 no longer have stand alone SDK installers
There are frameworks that are way past their prime and really shouldn’t be used anymore, but as I mentioned before some of us don’t have a choice and need to continue to support these things until they can properly be upgraded or replaced. I don’t know when this happened, so I am probably late to the party, but regardless it happened and I still needed dot net framework 4.5 for a legacy project.
I want you to appreciate how old this installer is. It shows you how long it would take to download this on Dial-Up and Broadband. It makes me feel ancient to remember using this and waiting minutes for this thing to install via a 56K modem. I don’t miss those days.
The wrong way to get the installers
As is with most things in life, you have to do it the wrong way so you learn how to do it the right way by learning from your mistakes. I am documenting this so hopefully other people don’t have to deal with the time waste this was.
Do NOT use the individual dot net framework SDK installers. It’s a waste of your time.
I obviously cannot stop anyone from doing this, but just as a friendly warning – don’t bother using the stand alone installers, especially if you realize later there isn’t a supported framework SDK installer anymore like I did. Here is a list of installers I accumulated because I’m an idiot and I did install all of these before realizing what mistake I made:
For 3.5 and 4.8 you can use add/remove Windows Features
- 3.5 is installed via windows features
- 4.8 is installed via windows features, but going to install anyhow
Available Visual Studio SDKs stand alone installers
This is the landing page for getting SDKs: https://dotnet.microsoft.com/en-us/download/visual-studio-sdks
If you want to just skip all the noise and get straight to the installers here you are.
- These are not SDKs even though it sounds like they are; these are run times only:
- The rest of these are SDKs:
- https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net451-developer-pack-offline-installer
- https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net452-developer-pack-offline-installer
- https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net46-developer-pack-offline-installer
- https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net461-developer-pack-offline-installer
- https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net462-developer-pack-offline-installer
- https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net47-developer-pack-offline-installer
- https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net471-developer-pack-offline-installer
- https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net472-developer-pack-offline-installer
- https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net48-developer-pack-offline-installer
- https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net481-developer-pack-offline-installer
The right way to get the installers
Over the last several years Microsoft has been producing Visual Studio Build Tools
which has been an absolute life saver in some cases for me. This is not limited to just dotnet-centric coding, I have had it save the day for things like Node.js and NPM too because on Windows systems at one point (maybe its still this way?) you needed to use Chocolaty in order to have a proper Node install which relied on VS2017 MSBuild C/C++ components that were needed by Python under the covers.
Well – if you didn’t have Visual Studio 2017 installed anymore, then you were kind of shit out of luck. That’s where the Visual Studio Build Tools comes in and why it’s not necessary to install individual SDKs anymore.
Go to the Visual Studio website and search for build tools
like so:
- https://visualstudio.microsoft.com/downloads/?q=build+tools
- You will find the build tools for VS 2022 first because it’s the latest version
- However, if you need support for older dot net framework versions then you can download the Visual Studio Build Tools that supported that old SDK in the past. This is like installing Visual Studio without installing Visual Studio.
Each one of those installers is going to plug itself into your existing Visual Studio Installer
which you should be familiar with already. Since that’s the case, make sure all instances of Visual Studio and the Installer are closed before running these installs.
The experience is going to be just like when you are installing Visual Studio, except you just need to focus on which BUILD components you need. This is how you get your older frameworks.
Visual Studio Built Tools 2017
As you can see below, there are the dot net 4.0 and 4.5 SDKs that I needed, but could not get outside of this installer. Honestly, this is far more convenient than individual installers so I am not complaining.
After installing build tools
This is what your Visual Studio Installer will look like after you install the individual build tool packs. What’s beneficial about this setup, is you can at any time modify the packs. This means if you forgot something, no problem hop into the installer, look around, check off items and install what you missed. Likewise – if you don’t want something anymore, just remove it. This is honestly an excellent quality of life improvement for all developers.
I use all of these build tools. When I don’t anymore I hope to uninstall the older ones.
Hopefully this helps folks out there make sense of seemingly out of no where build errors. Pay attention to which MSBuild it is complaining about. That’s the key.