I have a Blazor WASM Pipeline Release build that was running well until I upgraded to .NET5. Lately I get the following error: ...\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): Error MSB4018: The "GenerateServiceWorkerAssetsManifest" task failed unexpectedly.
followed by 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'.
My yaml
-file:
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'
So for some reason I think it cannot find the file service-worker-assets.js
, but I don't know why. For the ones wondering why the structure might be strange: I have a solution file that I use to restore nuget-packges and in this pipeline I just want to build a specific project BlazorProject.csproj
(which was working fine until I upgraded to .NET5).
Anyone knows, what's suddenly up with service-worker-assets.js
?
Azure DevOps: Blazor Deployment fails in Pipeline Build
There is an issue about it:
Blazor Service Worker Asset Manifest path construction bug
And this issue was moved to the Next sprint planning milestone for future evaluation / consideration. And aspnetcore team will evaluate the request when they are planning the work for the next milestone.
Besides , in order to ensure that you have upgraded your project correctly, please refer to the following documents for some more details:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.