0
votes

I am having Kudu issues while deploying a ASP.NET Core 2.2 app to Azure. The application was migrated from 2.1 -> 2.2 and deployed just fine before the upgrade.

I have used this document as reference

Deployment Error Log:

    Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment.
  Restoring packages for D:\home\site\repository\Source\PlanetDiego.Core\PlanetDiego.Core.csproj...
D:\Program Files (x86)\dotnet\sdk\2.2.100\NuGet.targets(114,5): error : Could not find file 'D:\home\.nuget\newtonsoft.json\6.0.4\newtonsoft.json.6.0.4.nupkg'. [D:\home\site\repository\Source\PlanetDiego.sln]
Failed exitCode=1, command=dotnet restore "D:\home\site\repository\Source\PlanetDiego.sln"
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\79.11121.3655\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

Interestingly every deployment attempt returns a different erroneous dependency error:

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment.
  Restoring packages for D:\home\site\repository\Source\PlanetDiego.Core\PlanetDiego.Core.csproj...
D:\Program Files (x86)\dotnet\sdk\2.2.100\NuGet.targets(114,5): error : Could not find file 'D:\home\.nuget\awssdk.core\3.3.0\awssdk.core.3.3.0.nupkg'. [D:\home\site\repository\Source\PlanetDiego.sln]
Failed exitCode=1, command=dotnet restore "D:\home\site\repository\Source\PlanetDiego.sln"
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\79.11121.3655\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

csproj file. As you can see, there is no dependency on newtonsoft.json.6.0.4.nupkg or awssdk.core.3.3.0.nupkg. The version specified is 12.0.1 and 3.3.29, respectively. I tried going to the Kudu Console in Azure and deleting deploy.cmd and deploymentCacheKey in the D:\home\site\deployments\tools folder. Unfortunately no effect.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <AssemblyName>PlanetDiego.Core</AssemblyName>
    <PackageId>PlanetDiego.Core</PackageId>
    <LangVersion>latest</LangVersion>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="AWSSDK.Core" Version="3.3.29.13" />
    <PackageReference Include="AWSSDK.S3" Version="3.3.31" />
    <PackageReference Include="AWSSDK.SimpleEmail" Version="3.3.7.15" />
    <PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
    <PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" />
    <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
    <PackageReference Include="TweetinviAPI" Version="4.0.0" />
  </ItemGroup>

</Project>
2
It appears someone stumbled upon the same problem. github.com/projectkudu/kudu/issues/2914Diego

2 Answers

1
votes

Try deleting the D:\home\.nuget\ directory and then re-running the restore/deployment.

0
votes

It seems that I was able to deploy the app with target framework 2.1 and Azure Tools extension in the Visual Studio Code. dotnet publish -c Relase, then right click bin/Release/netcoreapp2.1/publish folder and Deploy To Web App.

The SDK 2.2 is new, maybe it is broken on Azure now.