-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 not showed as an option #95651
Comments
Hi @indcoder, thanks for bringing this to our attention. I have assigned the issue to the content author to evaluate and update this doc as appropriate |
I ran into this issue as well. Running the following command when in the base Blazor WASM project directory and browsing to the application running at http://localhost:4280 displays a 404 page, which makes sense.
We're serving content out of Client\wwwroot, so I changed it to the following:
Doing this loaded the index.html file, but _framework/blazor.webassembly.js 404's. This is because the WASM project isn't actually running at this point. My solution was to open a second terminal in VS Code, run the client project using dotnet run and then start the API in the original terminal using this command:
The above command still ran something on http://localhost:4280, but I ignored it and navigated to https://localhost:7192 since that's the port that the client was actually running on. I then ran into the issue of the HttpClient's BaseAddress pointing to the WASM client's base address, not the API's base address which is different because it's running on a different port, so I had to find a workaround for that. I partially followed this guide https://www.dotnetcurry.com/aspnet-core/deploy-blazor-webassembly-azure-static-web-apps Particularly the section about creating an appsettings.Development.json file under Client\wwwroot and configuring the base address for the functions API running locally on http://localhost:7071. After getting the result I was looking for locally, I continued with the guide from this point https://learn.microsoft.com/en-us/azure/static-web-apps/add-api?tabs=vue#add-api-location-to-workflow and had no issues with the actual production site once it published through Github Actions. Repo: https://github.com/andrew-gaston/my-first-static-web-app Sorry for the lengthy write-up, I hope it all made sense. I was determined to both make it work locally and document it. There's probably a better way than how I did it because it took me far too long to get it going. |
Thanks for providing feedback that helps improve our documentation. This issue has been resolved and we are closing the issue. #please-close |
In the introduction to Azure SWA , we have sample code for 5 options including No framework, 3 Javascript frameworks and Blazor.
But in this page API which follows the above creation, we see only No framework and the 3 JS frameworks. But, Blazor is strangely missing.
IMO, since the creation of Blazor SWA and API are part of the same Azure SWA documentation, it should be standardized and consistent in terms of frameworks and their code samples.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: