Getting the following error when deploying a Blazor Server App using Deployment Center: Azure Repos

Fin Watling (student) 0 Reputation points
2024-04-15T17:46:24.84+00:00

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.

My application runs fine locally and was deploying fine up until around a week ago.

I don't know what else could have changed - Is there a way of customising the deployment?

Command: "C:\home\site\deployments\tools\deploy.cmd"

Handling ASP.NET Core Web Application deployment with MSBuild16.

Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.

Build started 4/15/2024 5:23:57 PM.

Project "C:\home\site\repository\Doccy\Doccy.csproj" on node 1 (Restore target(s)).

Restore:

Restoring packages for C:\home\site\repository\Doccy\Doccy.csproj...

Committing restore...

Assets file has not changed. Skipping assets file writing. Path: C:\home\site\repository\DataAccess\obj\project.assets.json

Restore completed in 66.95 ms for C:\home\site\repository\DataAccess\DataAccessLibrary.csproj.

Committing restore...

Writing assets file to disk. Path: C:\home\site\repository\Doccy\obj\project.assets.json

Restore completed in 615.04 ms for C:\home\site\repository\Doccy\Doccy.csproj.

NuGet Config files used:

  D:\DWASFiles\Sites\#1Doccy\AppData\NuGet\NuGet.Config

Feeds used:

  https://api.nuget.org/v3/index.json

Done Building Project "C:\home\site\repository\Doccy\Doccy.csproj" (Restore target(s)).

Project "C:\home\site\repository\Doccy\Doccy.csproj" on node 1 (default targets).

C:\Program Files (x86)\MSBuild-16.4\MSBuild\Current\Bin\Microsoft.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:\home\site\repository\Doccy\Doccy.csproj]

Done Building Project "C:\home\site\repository\Doccy\Doccy.csproj" (default targets) -- FAILED.

Build FAILED.

"C:\home\site\repository\Doccy\Doccy.csproj" (default target) (1:7) ->

(GetReferenceAssemblyPaths target) ->

C:\Program Files (x86)\MSBuild-16.4\MSBuild\Current\Bin\Microsoft.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:\home\site\repository\Doccy\Doccy.csproj]

0 Warning(s)

1 Error(s)

Time Elapsed 00:00:02.17

Failed exitCode=1, command="C:\Program Files (x86)\MSBuild-16.4\MSBuild\Current\Bin\MSBuild.exe" /restore "C:\home\site\repository\Doccy\Doccy.csproj" /p:DeployOnBuild=true /p:configuration=Release /p:publishurl="C:\local\Temp\8dc5d70d5226068"

An error has occurred during web site deployment.

\r\nC:\Program Files (x86)\SiteExtensions\Kudu\102.10305.001\bin\Scripts\starter.cmd "C:\home\site\deployments\tools\deploy.cmd"

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,385 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,393 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Fin Watling (student) 0 Reputation points
    2024-04-17T18:07:57.8366667+00:00

    SOLUTION:

    I just wanted to update this for anyone struggling with the same issue when deploying a Blazor Server application via Azure Deployment Center.

    I saw a thread - https://stackoverflow.com/questions/60676386/kudu-not-supported-net-core-3-1-can-not-autodeploy-my-net-core-3-1-function-f that suggested kudu might not support some versions of net core. Alex AIT suggested:

    You need to build your application before pushing it to Kudu, or wait until the 3.1 SDK is installed on the windows systems. You can also still try to use a Linux App Service.

    After recognising that the problem was with Kudu, I created a new Deployment but instead of a windows system, I used a Linux system:

    User's image

    The Linux machine has a different builder (Microsoft Oryx) and correctly identified the required auto build script.

    If you're facing a similar problem then I would suggest the reader to use a Linux OS for their hosting.

    Thanks to anyone who offered advice.

    0 comments No comments