Closed amis92 closed 2 years ago
Thanks for contacting us.
We're moving this issue to the Next sprint planning
milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
This started happening to me all the time after moving my project to 5. Cut my dev time to a total crawl.
So - I'm guessing this isn't going to fixed anytime in the near future? What is the work around for this? This halts any work I can do in Blazor.
So - I'm guessing this isn't going to fixed anytime in the near future? What is the work around for this? This halts any work I can do in Blazor.
I just deleted all bin / obj folders in the project and did a clean / rebuild on the solution and it worked fine.
Same error here: https://github.com/andreatosato/azure-static-app-pushnotification/actions When debug work well. When build locally work well:
dotnet publish ./src/Client/Blazoring.PWA.Client.csproj -c Release -o blazor -f NET5.0
On Github action there is error!
suspect related to https://github.com/dotnet/aspnetcore/issues/29939
I deleted bin and obj files, Cleaned and Build - no change. Still have same issue.
@javiercn Any idea if this is resolved with the 6.0 SWA updates?
I believe so
@javiercn assigning this to you to unskip this test: https://github.com/dotnet/sdk/blob/main/src/Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIntegrationTest.cs#L492 if this issue is resolved.
@pranavkm sign-off and merge when happy? https://github.com/dotnet/sdk/pull/22463
Describe the bug
When
BaseIntermediateOutputPath
is non-default,GenerateServiceWorkerAssetsManifest
task fails.To Reproduce
Repro repo: https://github.com/amis92/BlazorSwamPathBugRepro
Exceptions (if any)
Exception stack trace
C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): error MSB4018: The "GenerateServiceWorkerAssetsManifest" task failed unexpectedly. [C:\Users\Amadeusz\Source\Repos\BlazorSwamPathBugRepro\BlazorSwamPathBugRepro.csproj] C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\Amadeusz\Source\Repos\BlazorSwamPathBugRepro\obj\Debug\net5.0\service-worker-assets.js'. [C:\Users\Amadeusz\Source\Repos\BlazorSwamPathBugRepro\BlazorSwamPathBugRepro.csproj] C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): error MSB4018: at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) [C:\Users\Amadeusz\Source\Repos\BlazorSwamPathBugRepro\BlazorSwamPathBugRepro.csproj] C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): error MSB4018: at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) [C:\Users\Amadeusz\Source\Repos\BlazorSwamPathBugRepro\BlazorSwamPathBugRepro.csproj] C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [C:\Users\Amadeusz\Source\Repos\BlazorSwamPathBugRepro\BlazorSwamPathBugRepro.csproj] C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) [C:\Users\Amadeusz\Source\Repos\BlazorSwamPathBugRepro\BlazorSwamPathBugRepro.csproj] C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): error MSB4018: at System.IO.File.Create(String path) [C:\Users\Amadeusz\Source\Repos\BlazorSwamPathBugRepro\BlazorSwamPathBugRepro.csproj] C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): error MSB4018: at Microsoft.NET.Sdk.BlazorWebAssembly.GenerateServiceWorkerAssetsManifest.Execute() [C:\Users\Amadeusz\Source\Repos\BlazorSwamPathBugRepro\BlazorSwamPathBugRepro.csproj] C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Users\Amadeusz\Source\Repos\BlazorSwamPathBugRepro\BlazorSwamPathBugRepro.csproj] C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(68,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [C:\Users\Amadeusz\Source\Repos\BlazorSwamPathBugRepro\BlazorSwamPathBugRepro.csproj]Further technical details
dotnet --info
:dotnet --info output
VS/ VS Code/VS4Mac) you're running on, and it's version Version: 1.49.0 (system setup) Commit: e790b931385d72cf5669fcefc51cdf65990efa5d Date: 2020-09-10T13:22:08.892Z Electron: 9.2.1 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Windows_NT x64 10.0.18363Personal investigation
The issue seems to crop up in Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets which is part of
Microsoft.NET.Sdk.BlazorWebAssembly
in this repository:https://github.com/dotnet/aspnetcore/blob/50eb578c738bf007f0a37efcdc99ee72157b9dd1/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets#L19-L21
First of all, when the
BaseIntermediateOutputPath
is rooted, it doesn't actually use any user-set path and instead just forces the path to be relative and arbitrary, which doesn't seem to be correct (but maybe I'm missing something):However, the second case looks like it should work, except it doesn't seem possible for the
BaseIntermediateOutputPath
to not be rooted at that point, because of the following:https://github.com/dotnet/sdk/blob/d7ee9e27927f11c7e1b8ad1f48bcbffd2ac7a000/src/WebSdk/Publish/Targets/Microsoft.NET.Sdk.Publish.targets#L74-L75
Additionally I'm concerned that the
_ServiceWorkerAssetsManifestIntermediateOutputPath
itself shouldn't be used at all in other targets in that file and it is (the failing task itself takes it as an input); instead the_ServiceWorkerAssetsManifestFullPath
probably should be.