![](/img/trans.png)
[英]Blazor WebAssembly Azure DevOps build pipeline publish artifacts
[英]Azure DevOps: Blazor Deployment fails in Pipeline Build
我有一個 Blazor WASM 管道發布版本,它運行良好,直到我升級到 .NET5。 最近我收到以下錯誤: ...\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): Error MSB4018: The "GenerateServiceWorkerAssetsManifest" task failed unexpectedly.
后跟System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\a\1\s\ClientSide\BlazorProject\obj\Release\net5.0\service-worker-assets.js'.
我的yaml
文件:
trigger:
- main
pool:
vmImage: 'windows-latest'
variables:
solution: '**/BlazorProject.csproj'
solutionSln: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '$(solutionSln)'
feedsToUse: 'select'
noCache: true
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)/WebClient.zip"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
clean: true
createLogFile: true
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'censored'
appType: 'webApp'
WebAppName: 'nextGenClientTest'
packageForLinux: '$(build.artifactStagingDirectory)/WebClient.zip'
所以出於某種原因,我認為它找不到文件service-worker-assets.js
,但我不知道為什么。 對於那些想知道為什么結構可能很奇怪的人:我有一個用於恢復 nuget-packges 的解決方案文件,在這個管道中我只想構建一個特定的項目BlazorProject.csproj
(在升級到 .NET5 之前它工作正常)。
任何人都知道, service-worker-assets.js
突然發生了什么?
Azure DevOps:Blazor 在管道構建中部署失敗
關於它有一個問題:
Blazor Service Worker Asset Manifest 路徑構建錯誤
並且此問題已移至下一個 sprint 計划里程碑,以供將來評估/考慮。 aspnetcore 團隊將在他們為下一個里程碑計划工作時評估該請求。
此外,為確保您已正確升級項目,請參閱以下文檔了解更多詳細信息:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.