skip to Main Content

I have an app for a personal project set up as an app service on Azure. It used a WebHook to get the code, connecting it from the deployment center, but suddenly it started failing. The last commit, when it was working, was a week ago. So I set up a new test project, using purely the default code for an ASP.NET Core 8 MVC web app. It runs locally, but when Azure tries to build it, it seems to be failing too with the following error:

C:Program Files (x86)MSBuild-16.4MSBuildCurrentBinMicrosoft.Common.CurrentVersion.targets(1175,5): error MSB3644: The reference assemblies for .NETFramework,Version=v8.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 [C:homesiterepositoryTestAppTestAppTestApp.csproj]

My other alternative is using a pipeline, but this method is a lot simpler and doesn’t require me to wait several days to request a grant to run it.

It seems like an issue with Azure but I could be wrong.

2

Answers


  1. Chosen as BEST ANSWER

    This can be fixed by downgrading to .Net 7. It's not an ideal solution, but there are no project changes, so if anybody else has this issue, that's the best solution until it gets fixed.


  2. The issue seems to be that the deployment script your CI pipeline is using refers the MSBuild version 16.4 (looking at the path in error message) which it seems is not compatible with .NET 8.

    As a fix you can use custom deployment script for kudu and update path to MSBuild version 16.7.0:

    instead of

    :: 1. Restore, Build and publish
    call :ExecuteCmd "%MSBUILD_16_DIR%MSBuild.exe" /restore "%DEPLOYMENT_SOURCE%<Project name>.csproj /p:DeployOnBuild=true /p:configuration=Release /p:publishurl="%DEPLOYMENT_TEMP%" %SCM_BUILD_ARGS%
    

    use something like

    call :ExecuteCmd "%MSBUILD_1670_DIR%MSBuild.exe" /restore "%DEPLOYMENT_SOURCE%<Project name>.csproj /p:DeployOnBuild=true /p:configuration=Release /p:publishurl="%DEPLOYMENT_TEMP%" %SCM_BUILD_ARGS%
    

    This should fix your deployment issues. We were facing the same issue with kudu deployment on our Azure repos and using custom deployment scripts fixed the same.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search