.NET Framework 4.0 SDK in VS 2022 image

slepov's Avatar

slepov

13 Jan, 2023 12:25 PM

I am getting the following error while using the VS 2022 image and trying to target .NET 4:

error MSB3644: The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

https://ci.appveyor.com/project/morpher/yandex-checkout-v3/builds/45929857

Can we install the .NET 4 targeting pack/ sdk in the VS 2022 image please?

  1. Support Staff 1 Posted by Feodor Fitsner on 13 Jan, 2023 06:38 PM

    Feodor Fitsner's Avatar

    This is a script that being used to install .NET Framework SDKs on a build image: https://github.com/appveyor/build-images/blob/master/scripts/Window...

    As you see 4.8 DevPack is being installed. If you know what pack is missing you can try installing it during the build to see if that works and if it does we can roll it out during the next image update.

  2. 2 Posted by slepov on 14 Jan, 2023 03:21 PM

    slepov's Avatar

    Hi Feoder, thanks for your response.

    While looking for the .NET 4.0 Dev Pack, I found this:

    Starting with Visual Studio 2022, Visual Studio no longer includes .NET Framework components for .NET Framework 4.0 - 4.5.1 because these versions are no longer supported. Visual Studio 2022 and later versions can't build apps that target .NET Framework 4.0 through .NET Framework 4.5.1. To continue building these apps, you can use Visual Studio 2019 or an earlier version.

    https://learn.microsoft.com/en-us/dotnet/framework/install/guide-for-developers

    Targeting .NET 4.0 in VS 2022 works on my machine, probably because I also have VS 2019 installed.

    Well, if Microsoft dropped support for .NET 4.0, maybe it is time for us library developers to drop it too.

  3. Support Staff 3 Posted by Feodor Fitsner on 15 Jan, 2023 05:09 AM

    Feodor Fitsner's Avatar

    Or you can use VS 2019 image.

  4. Feodor Fitsner closed this discussion on 17 Mar, 2023 09:02 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac