New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blazor Service Worker Asset Manifest path construction bug #25959
Comments
Thanks for contacting us. |
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. |
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
On Github action there is error! |
suspect related to #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? dotnet/sdk#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 versionVersion: 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.18363
Personal 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:aspnetcore/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets
Lines 19 to 21 in 50eb578
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.The text was updated successfully, but these errors were encountered: