Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ASP.NET核心从2.1迁移->;2.2 Azure部署中的依赖项问题_C#_Azure_Azure Web App Service_Azure Deployment_Asp.net Core 2.2 - Fatal编程技术网

C# ASP.NET核心从2.1迁移->;2.2 Azure部署中的依赖项问题

C# ASP.NET核心从2.1迁移->;2.2 Azure部署中的依赖项问题,c#,azure,azure-web-app-service,azure-deployment,asp.net-core-2.2,C#,Azure,Azure Web App Service,Azure Deployment,Asp.net Core 2.2,在将ASP.NET Core 2.2应用程序部署到Azure时,我遇到了Kudu问题。该应用程序是从2.1->2.2迁移而来的,在升级之前部署得很好 我已将此作为参考 部署错误日志: Command: "D:\home\site\deployments\tools\deploy.cmd" Handling ASP.NET Core Web Application deployment. Restoring packages for D:\home\site\repository\So

在将ASP.NET Core 2.2应用程序部署到Azure时,我遇到了Kudu问题。该应用程序是从2.1->2.2迁移而来的,在升级之前部署得很好

我已将此作为参考

部署错误日志:

    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"
有趣的是,每次部署尝试都会返回不同的错误依赖项错误:

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文件。如您所见,不依赖newtonsoft.json.6.0.4.nupkg或awssdk.core.3.3.0.nupkg。指定的版本分别为12.0.1和3.3.29。 我尝试转到Azure中的Kudu控制台,删除D:\home\site\deployments\tools文件夹中的deploy.cmd和deploymentCacheKey。不幸的是没有效果

<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>

netstandard2.0
行星地心
行星地心
最新的
假的
假的
假的

我似乎能够在Visual Studio代码中使用target framework 2.1和Azure Tools扩展部署该应用程序
dotnet publish-c Relase
,然后右键单击bin/Release/netcoreapp2.1/publish文件夹并部署到Web应用程序


SDK 2.2正在运行,可能它现在在Azure上已损坏。

尝试删除
D:\home\.nuget\
目录,然后重新运行还原/部署。

似乎有人遇到了相同的问题。是的,我在Azure上部署了几个2.1应用程序,没有问题。我相信2.2 SDK自6月12日起就在Azure上得到了官方支持。但是,当通过Githib或Bitbucket部署时,包还原失败。是的,我也有同样的问题。所以,我建议您可以打开一个问题,检查sdk是否有问题?请参阅我原始帖子中的评论。似乎已经有一张未结的票了。谢谢,谢谢,成功了!成功地重新映射到正确的包。为了使它工作,我还必须将它作为一个Outofprocess-Outofprocess运行。