Search code examples
.netvisual-studiovisual-studio-2013

How to force install .NET Framework 4.5.2


So I just cloned my repository, which I created on my other PC, and it appears the .NET Framework was set to 4.5.2. I have 4.6.2 on this current PC, and I get the following error when I try to launch the project:

I have tried to install 4.5.2, but it says I already have it installed, or another, newer installation is already installed.

If I edit my Project.csproj file and change TargetFrameworkVersion from v4.5.2 to v4.6.2 I get the same error. If I change it to 4.5 (which is appears I have on my PC as well), I get a lot of reference errors in my project, which I have to manually go edit. Some of them appears not to work with 4.5, as they were introduced in 4.5.2, so that's definitely not an option.

What on earth do I do?


Solution

  • You of course can have the runtime installed already, but Visual Studio is asking for the Developer Pack,

    https://support.microsoft.com/en-ca/help/2901951/the-microsoft-.net-framework-4.5.2-developer-pack-for-windows-server-2012-r2,-windows-8.1,-windows-server-2012,-windows-8,-windows-server-2008-r2-sp1,-windows-7-sp1,-windows-server-2008-sp2,-and-windows-vista-sp2

    If you don't know that, now you should.

    Update: Many .NET Framework versions went end of life recently, so you can only find the remaining in https://dotnet.microsoft.com/download/visual-studio-sdks?cid=getdotnetsdk