dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.26k stars 9.96k forks source link

Publication of Blazor Apps with 'Individual Accounts' break the publication process #55554

Open Stefano-Buzzoni opened 4 months ago

Stefano-Buzzoni commented 4 months ago

Is there an existing issue for this?

Describe the bug

When I try to realease my Blazor Web App with .NET 8 and 'Individual Accounts' as authentication method on a company hosted server via IIS, the release process stop by throwing the error I will copy below.

Expected Behavior

I expect the application to be normally deployed on the server, just like their 'dumb' counterparts apps without the 'Individual Accounts' authentication method.

Steps To Reproduce

Just create a 'dumb' Blazor Web App with .NET 8 with 'Individual Accounts' as login method, check if it runs correctly and deploy it on a IIS server and see that it fails. Create another one without any authentication method and see that you can deploy it without any problems

Exceptions (if any)

Retrying the 'Serialization' operation on the sitemanifest (sourcePath) object. Attempt 2 of 50. (and so on until 50 tries) Added file ({sitename}/{appName}\wwwroot_content\Microsoft.AspNetCore.Components.WebAssembly.Authentication\AuthenticationService.js). C:\Program Files\dotnet\sdk\8.0.200\Sdks\Microsoft.NET.Sdk.Publish\targets\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): Warning: Retrying synchronization following a socket error (10054).

.NET Version

8.0.200

Anything else?

No response

mkArtakMSFT commented 4 months ago

@vijayrkn looks like this is publishing related error. Do you know what may be causing this? Can you please take a look? Thanks!

Stefano-Buzzoni commented 4 months ago

@vijayrkn looks like this is publishing related error. Do you know what may be causing this? Can you please take a look? Thanks!

My honest opinion is that authentication with 'individual accounts' has a bug that prevents the publishing process from running correctly. I tried to create a Blazor Web Assembly test application with .Net 7 and the same authentication mode only to have its deployment fail in the same way. Same template layout, same framework version but without authentication publishes correctly actually, while a further test with a Blazor Web App with .NET 8 without authentication was published correctly as well. That's all I have to suggest, I hope it helps somehow.

I named my test projects with the very same name as the actual project and I published them, or at least I tried to, in the very same destination folder in which the actual one is meant to be and then deleted every file either when the process succeded or failed.

halter73 commented 3 months ago

Added file ({sitename}/{appName}\wwwroot_content\Microsoft.AspNetCore.Components.WebAssembly.Authentication\AuthenticationService.js).

Microsoft.AspNetCore.Components.WebAssembly.Authentication is not part of the .NET 8 Blazor Web App with 'Individual Accounts' project template. Can you provide a complete repro of the app that fails to publish?

Stefano-Buzzoni commented 3 months ago

Greetings, here's the link to the repro, there is really nothing special, just a base Blazor Web App template with "Individual Accounts" auth and "WebAssembly" as render mode. Only need to try and publish it on a IIS server as "Web Distribution". Please let me know if more info are needed.

Edit As you can see the mentioned package is actually present in the "virgin" template that fails in the same way as I try to publish it on my server.