Skip to content

breaking change - static files moved out of cloudscribe.Web.Common #6

@joeaudette

Description

@joeaudette

Recently all static files were moved out of the cloudscribe.Web.Common library as of version 3.0.6, those files now live in cloudscribe.Web.StaticFiles which is referenced by cloudscribe.Web.Common so the package will come in automatically.

However there is a breaking change if you upgrade to cloudscribe.Core.Web 3.1, the common static files middleware is no longer automatically wired up by cloudscribe.Core. So to solve that in your own project after upgrading to cloudscribe.Core.Web 3.1 or newer you need to add this on the Configure method of startup after other static files middleware:

app.UseCloudscribeCommonStaticFiles();

the reasons for this change are discussed here: cloudscribe/cloudscribe#434

The advantage of separating the static files and not opting into using them automatically from cloudscribe core is that now it is possible to leave that line out and instead copy all the static files into your own project and serve them from disk. In low budget hosting this can be beneficial because it will not load the assembly for the static files into memory and therefore will consume slightly less memory.

If you do want to host those files locally in your project file system instead of using them as embedded resources, you can do so as follows:

  1. create a folder named cr under wwwroot (this is needed as it is part of the path for the embedded files)
  2. copy the js, css, fonts, and images folders from the source code here into the cr folder

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions