Randomly a couple of days ago my continuous integration builds stopped working with the error error MSB3644: The reference assemblies for .NETFramework,Version=v8.0 were not found.
But I hadn’t made any changes to the .net version as I’d been on .net 8 for several months already. My configuration is set to .net 8:
I’ve tried adding a global.json file as suggest on this question (that also happened at the exact same time):
https://learn.microsoft.com/en-us/answers/questions/1654812/msbuild-16-4-msb3644-error-net-8-deployment-center?page=1&orderby=Helpful&comment=answer-1506815#newest-answer-comment
Firstly it didn’t like sdk version 8.0.204 but hinted that 8.0.101 might work so I tried that and now get this error: Version 8.0.101 of the .NET Core SDK requires at least version 17.7.0 of MSBuild. The current available version of MSBuild is 16.4.0.56107. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.
The only thing I can think is that microsoft somehow removed the .net 8 libraries from a few of there web servers?? What can I do?
2
Answers
I had the same problem. So, I changed a way to deploy code following this document:
Publish an ASP.NET Core app to Azure with Visual Studio Code
As described in the document, I generated a release package in my local environment (Visual Studio Code) and deployed the package using the Azure App Service Extension.
If the "continuous integration builds" you mentioned built in the azure devops pipeline, try using
vmImage: windows-2022
, in which the .Net8 SDK and msbuild 17.9.x are installed by default. Here is the software list of it windows-2022.