Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Document how to use static web assets feature in all environments #13864

Closed
rynowak opened this issue Aug 16, 2019 · 7 comments · Fixed by #13911
Closed

Document how to use static web assets feature in all environments #13864

rynowak opened this issue Aug 16, 2019 · 7 comments · Fixed by #13911
Assignees
Labels

Comments

@rynowak
Copy link
Member

rynowak commented Aug 16, 2019

see: dotnet/aspnetcore#13190

We should make sure the docs include the difference between how this feature behaves in production vs development, and how to override this.

@javiercn
Copy link
Member

We simply need to add a line to the docs that says

Static web assets are enabled by default during Development. If you want to explicitly support static web assets in other environments you can do so by calling
webHostBuilder.UseStaticWebAssets()

(Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.UseStaticWebAssets(this IWebHostBuilder builder))

@javiercn
Copy link
Member

@guardrex Is this something we can get added to the RCL docs?

@akorchev
Copy link

Static web assets seem to work fine in production without explicitly invoking UseStaticWebAssets. Tested by running dotnet publish -c Release and then running the app itself via dotnet app.dll.

@javiercn
Copy link
Member

@akorchev

The helper methods described above are only used when running the app from the build output (dotnet run) when the app gets published we simply copy the assets to their final destination and there is no additional runtime code required to make it work.

@javiercn
Copy link
Member

@guardrex Can you also indicate that this is only required for non-published apps and that at publish time the assets are simply in their final locations?

@guardrex
Copy link
Collaborator

@javiercn Already done on the PR.

@javiercn
Copy link
Member

Thanks! That was quick!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants