mingyaulee / Blazor.BrowserExtension.Samples

Sample projects using Blazor to build browser extensions
MIT License
21 stars 5 forks source link

How to publish the extensions so they can be loaded by Chrome? #7

Closed Tony20221 closed 5 months ago

Tony20221 commented 5 months ago

How did the sample extensions get published to the browserextension folders?

If I publish in Visual Studio where the destination is ../dist\, VS creates a wwwroot folder under the dist folder with subfolder names _content & _framework and Chrome refuses to load an extension from folders that start with an underscore.

mingyaulee commented 5 months ago

The samples are published using the standard dotnet publish command. The publish output will contain a directory named browserextension, which is where you can load the extension into Chrome.

I have not tried publishing using VS, but I suspect that it will be calling to the same command for publishing new .Net projects, so the output should be the same.

Tony20221 commented 5 months ago

The dotnet publish command worked. It seems publishing within VS works differently.