Blazor WASM 3.1 to Net5: Publish failed
See original GitHub issueI have migrated a blazor wasm application hosted in asp.net core from Net core 3.1 to Net 5 following the steps described in https://docs.microsoft.com/it-it/aspnet/core/migration/31-to-50?view=aspnetcore-5.0&tabs=visual-studio.
All work well except when i try to publish.
The publish process fail with this output:
The process cannot access the file 'C:\ARTCreditService\ARTCreditService.Client\obj\Release\net5.0\compress\WxGTI0fM.br' because it is being used by another process.
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode)
at Microsoft.NET.Sdk.BlazorWebAssembly.Tools.BrotliCompressCommand.<ExecuteCoreAsync>b__16_0(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica`1.ExecuteAction(Boolean& yieldedBeforeCompletion)
at System.Threading.Tasks.TaskReplicator.Replica.Execute()
C:\Program Files\dotnet\sdk\5.0.101\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets(564,5): Error MSB6006: "dotnet.exe" exited with code 1.
If i rollback to .net core 3.1 the publish process work well
What’s wrong?
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (3 by maintainers)
Top Results From Across the Web
error in publish blazor-wams version.net5 after install ...
I have to publish from an old station which is the only one that have not been upgraded to VS 2022. This is...
Read more >Publish .net 5 web assembly site to IIS fails
i created sample app for blazor web assembly .net 3.1 deployed to site...works. i created sample app for blazor server .net 5 deployed...
Read more >Blazor WASM Project Referencing Error (BLAZORSDK1001)
I have one Server project and now trying to convert it into Progressive Web Application. When I reference the API, Model, and UI...
Read more >Blazor WebAssembly 3.2.0 Preview 3 release now available
This error occurs when assemblies shared by the server and Blazor client project get removed during publish (see https://github.com/dotnet/ ...
Read more >Blazor WASM app won't load after publish. Works fine on ...
The published Wasm dont have them. If its the same error i got, then its a error while generating the publish version of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It would be great if Microsoft would provide an incentive - some sort of reward scheme for anyone that provides a minimal repro’s that is then used and accepted as identifying a valid bug (i.e it has provided value). (Similar to how whitehat hackers can be rewarded for finding and proving security holes). It takes many hours to work through producing some repro’s and I feel it’s slightly unfair to burden the community with this for things that do turn out to be providing value. The framework may be free / open source, but it does provide strategic value to MS. When a bug occurs on a given environment, there should be other ways to provide you with useful information such as MSBuild logs, stack trace, etc that can be used to reproduce or identify if there is a legitimate issue - enough at least not to auto-dismiss the issue. I’m going to timebox a day trying to create a minimal repro project - if I can’t then I’ll be at a loss, and our upgrade path from 3.1 to 5 will remain blocked until some good Samaritan can produce something of the level you require.
@dazinator i can confirm the same issue, also for me deleting the below elements seem to fix the issue! Thanks for the workaround!