Hi @Pongpak Santithamkul,
From the error message, .NET 9 may not be available in all regions.
You can try to verify it by using another region. We can also try to solve this problem by adding additional extensions.
Best Regards
Jason
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
After upgrading our application to use .NET 9, Azure app service build service is unable to build and deploy our application.
We already changed stack settings and continuous deployment settings to .NET 9
A deployment log shows that MSBuild version is out-of-date
"C:\home\site\repository\project-path" (default target) (1:7) ->
(_WarnWhenUsingNET9AndVSPriorTo1712 target) ->
C:\Program Files (x86)\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(135,5): warning NETSDK1223: Targeting .NET 9.0 or higher in Visual Studio 2022 17.11 is not supported. [C:\home\site\repository\project-path]
Any idea how to resolve this issue?
Hi @Pongpak Santithamkul,
From the error message, .NET 9 may not be available in all regions.
You can try to verify it by using another region. We can also try to solve this problem by adding additional extensions.
Best Regards
Jason
Pongpak Santithamkul, Just following-up, hope you add a chance to check the suggestions by Jason. Kindly try and let us know.
Adding to the above,
Version requirements for .NET 9 SDK
.NET 9.0.100 won't load in Visual Studio version 17.10 or earlier. Visual Studio version 17.11 doesn't make
net9.0
available in the project properties. .NET 9.0.100 warns when targetingnet9.0
and using Visual Studio version 17.11:NETSDK1223: Targeting .NET 9.0 or higher in Visual Studio 2022 17.11 is not supported.
As an alternative, you may define global.json file at the root of your project to force build using the correct .net version. Checkout this similar discussion thread.
global.json
{
"sdk": {
"version": "8.0.400",
"rollForward": "latestFeature"
}
}
If the answer helped (pointed, you in the right direction) > please click Accept Answer to benefit the community find answers quickly to similar question.
I tried both suggestions, but App Service Build Service still failed to build .NET 9 project. I think the problem is because a generated CI script is relying on MSBuild but there is no MSBuild 17.12 installed in the app service.
echo Handling ASP.NET Core Web Application deployment with MSBuild16.
:: 1. Restore, Build and publish
call :ExecuteCmd "%MSBUILD_16_DIR%\MSBuild.exe" /restore "%DEPLOYMENT_SOURCE%\Zortout.API.Core\Zortout.API.Core.Server\Zortout.API.Core.Server.csproj" /p:DeployOnBuild=true /p:configuration=Release /p:publishurl="%DEPLOYMENT_TEMP%" %SCM_BUILD_ARGS%
IF !ERRORLEVEL! NEQ 0 goto error
:: 2. KuduSync
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_TEMP%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
IF !ERRORLEVEL! NEQ 0 goto error
Full log:
Command: "C:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment with MSBuild16.
MSBuild version 17.11.2+c078802d4 for .NET Framework
Build started 12/2/2024 3:05:37 PM.
Project "C:\home\site\repository\MySolution\MyProj\MyProj.csproj" on node 1 (Restore target(s)).
_GetAllRestoreProjectPathItems:
Determining projects to restore...
Restore:
X.509 certificate chain validation will use the default trust store selected by .NET for code signing.
X.509 certificate chain validation will use the default trust store selected by .NET for timestamping.
Assets file has not changed. Skipping assets file writing. Path: C:\home\site\repository\MySolution\MyProj\obj\project.assets.json
Restored C:\home\site\repository\MySolution\MyProj\MyProj.csproj (in 518 ms).
Assets file has not changed. Skipping assets file writing. Path: C:\home\site\repository\MySolution\MySolution.Data\obj\project.assets.json
Restored C:\home\site\repository\MySolution\MySolution.Data\MySolution.Data.csproj (in 8 ms).
NuGet Config files used:
C:\home\site\repository\NuGet.Config
Feeds used:
https://api.nuget.org/v3/index.json
All projects are up-to-date for restore.
Done Building Project "C:\home\site\repository\MySolution\MyProj\MyProj.csproj" (Restore target(s)).
Project "C:\home\site\repository\MySolution\MyProj\MyProj.csproj" on node 1 (default targets).
C:\Program Files (x86)\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(135,5): warning NETSDK1223: Targeting .NET 9.0 or higher in Visual Studio 2022 17.11 is not supported. [C:\home\site\repository\MySolution\MyProj\MyProj.csproj]
C:\Program Files (x86)\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1060: Error reading assets file: Error loading lock file 'C:\home\site\repository\MySolution\MyProj\obj\project.assets.json' : Could not load file or assembly 'System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. [C:\home\site\repository\MySolution\MyProj\MyProj.csproj]
Done Building Project "C:\home\site\repository\MySolution\MyProj\MyProj.csproj" (default targets) -- FAILED.
Build FAILED.
"C:\home\site\repository\MySolution\MyProj\MyProj.csproj" (default target) (1:7) ->
(_WarnWhenUsingNET9AndVSPriorTo1712 target) ->
C:\Program Files (x86)\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(135,5): warning NETSDK1223: Targeting .NET 9.0 or higher in Visual Studio 2022 17.11 is not supported. [C:\home\site\repository\MySolution\MyProj\MyProj.csproj]
"C:\home\site\repository\MySolution\MyProj\MyProj.csproj" (default target) (1:7) ->
(ResolvePackageAssets target) ->
C:\Program Files (x86)\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1060: Error reading assets file: Error loading lock file 'C:\home\site\repository\MySolution\MyProj\obj\project.assets.json' : Could not load file or assembly 'System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. [C:\home\site\repository\MySolution\MyProj\MyProj.csproj]
1 Warning(s)
1 Error(s)
Time Elapsed 00:00:03.56
Failed exitCode=1, command="C:\Program Files (x86)\MSBuilds\17.11.2\MSBuild\Current\Bin\MSBuild.exe" /restore "C:\home\site\repository\MySolution\MyProj\MyProj.csproj" /p:DeployOnBuild=true /p:configuration=Release /p:publishurl="C:\local\Temp\8dd12a81a7f70c3"
An error has occurred during web site deployment.
\r\nC:\Program Files (x86)\SiteExtensions\Kudu\103.100930.002\bin\Scripts\starter.cmd "C:\home\site\deployments\tools\deploy.cmd"