[英]ASP.NET Core Migration from 2.1 -> 2.2 Issue with dependencies in Azure deployment
將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>
嘗試刪除D:\\home\\.nuget\\
目錄,然后重新運行還原/部署。
看來我能夠在Visual Studio Code中使用目標框架2.1和Azure工具擴展來部署該應用程序。 dotnet publish -c Relase
,然后右鍵單擊bin/Release/netcoreapp2.1/publish
文件夾並部署到Web App。
SDK 2.2是新的 ,也許現在在Azure上已被破壞。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.