Blazor wasm not serving static files from wwwroot after deploying to IIS - asp.net-core

I'm developing a .net 5.0 blazor wasm application. When I run the app form visual studio using IIS Express and navigate to https://localhost:5001/docs/simple.pdf, the file is served in browser.
However the same does not work after deploying the blazor wasm app to IIS. I'm not getting any error instead my Not Found Route template screen gets loaded.
Here is the screen prints:
wwwroot of blazor wasm app:
IISExpress loading the document:
IIS virtual directory path:
IIS not loading the document and display NotFound Route template:
I also noticed none of the files in wwwroot is not directly accessible in browser in IIS. Please assist on what I'm missing.

Blazor WebAssembly is not involved in serving your files.
This is something to configure in IIS.

This seems to be an issue with service-worker.published.js file coming with blazor wasm pwa template. This has been reported in dotnet/aspnetcore repo.
Please follow the issue in github for more updates.

I was able to reproduce your issue. Here is how I think you can fix it.
Navigate to the Server project inside your solution.
Open the file Startup.cs. Navigate to the Configure method and add this line of code:
app.UseStaticFiles();
Publish your project and recopy to IIS.
In the default Visual Studio template, this code will be there. But depending on how you created your solution, maybe you missed it.

Related

Getting a blank page after deploying static web app service in azure from already deployed Github pages

Github pages are perfectly running and i got no errors on workflow actions on deploying on azure,
but iam getting blank page on url provided by azure.
Please help to deploy my site on azure (static web app service) with already deployed github pages
it would be great help....
Update the basehref in index.html or you can delete that line from index.html

Is there a way to show file uploading progress bar when uploading a file from a blazor WebAssembly (WASM) to a ASP.NET Core server (blazor hosted)

As the title says, I'm looking for a way to inform users about the file upload progress of a file uploaded from the Blazor WebAssembly (WASM) client to the server project (Api).
P.S. I'm using NET 6.
Thanks.
https://github.com/agency8/BlazorFileUploadApp Had everything I needed, just clone it and you can get on with your work...
Thanks to #MisterMagoo for sharing the link!

Log In doesn't work after Abp .net core web app deployed to server

I use Abp.io framework and build .net core razor application including api.
It work perfectly on my localhost, but after I deploy to smarterasp.net, the login doesn't work anymore.
My URL is ,for example http://mybackendportal-001-site1.btempurl.com/.
I already change the appsetting of App:SelfUrl and AuthServer:Authority to above URL.
But still doesn't work, after login, it's redirect to login page again even the user name is password are correct, and no console error.
How can I fix this issue?
I fixed this issue by using this reference (How to fix the Chrome login issue for the IdentityServer4).

deploy ABP framwork angular into iis

I want to deploy ABP angular Application into IIS I don't know how.
I created a folder contain the backEnd Folder And The FrntEnd Folder then i build the frontend into the frontend Folder and in the visual studio, I publish the backend into the backEnd Folder
in IIS I created a website with the backEnd with HTTPS and inside the Website I created a App contain the frantEnd
the App works and the data appears in the list
but in create and update method not function
I look inside the log
It looks like you haven't changed the application settings.
https://github.com/abpframework/abp/blob/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json
https://github.com/abpframework/abp/blob/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json
You need to change application ports, URL. etc

“An unhandled error has occurred.” when using Identity scaffold elements in a Blazor application

Created a Blazor WebAssembly 3.2.0 Preview 3 application template using Individual User Accounts and the ASP.NET Core hosted parameter
At this point, everything starts up correctly and the standard Blazor application is displayed.
Added scaffold Registration and Login pages
The application starts without errors, but the display template stops working and a message appears the message “An unhandled error has occurred".
From this github issue
The Identity scaffolder adds a wwwroot folder to the Server project with the default set of styles and other assets for the default Identity UI. These styles then override the styles that come from the Client project. In particular, both the Client and Server projects end up with a css/site.css.
You have the following two options:
Change the name of site.css of wwwroot folder in Blazor Server project.
Remove the wwwroot folder in Blazor Server project.