Suchiman/BlazorDualMode

Where is index.html after publish?

Closed this issue · 5 comments

When I run the publish command the output does not include the index.html file required to deploy the project in client-only mode to a static-file web host such as github pages.

Command Used:
dotnet publish -c Release

Expected Output Directory:
bin\release\net*******\publish\wwwroot\

Dual mode uses the https://github.com/Suchiman/BlazorDualMode/blob/master/BlazorDualMode.Server/Pages/_Host.cshtml file because index.html does not work for server mode. You could have both an index.html and an _Host.cshtml which you'd need to keep in sync.

Thank you for the explanation and suggestion. I may attempt something like this and will update if it goes well.

Adding the index.html file did allow me to publish and serve the client project from a static http server, however doing this broke the FetchData tab because /api/SampleData/WeatherForecasts/ is no longer being served by the Server Host.

Comparing with my standalone WebAssembly application it seems the difference is that the standalone loads the data from a json file rather than from a .net core hosted controller, and so this endpoint not working should be expected.

I wanted to follow up in case anyone else is interested in doing the same.

I've upgraded this project to support deploying just the client in this commit:
vanderstack@8f97403

I've gone further and integrated BlazorWebView to add a WPF host to run natively on windows (mac and others are also available using other projects in the BlazorWebView library), and then included the latest Test Suite prototypes from Steve Sandersons blog.

A stable commit with these features is available here:
vanderstack@d58dbe5