Skip to content

SerenityStaticAssets class

namespace: Serenity.Web   assembly: Serenity.Net.Web

Serves static assets of packages that don't use the static web assets SDK (e.g. Serenity.Corelib) while running from the build output. The build writes a manifest named "[ApplicationName].serenitystaticassets.json" next to the application assembly, which lists the asset folders (project wwwroot or package staticwebassets folders) and their base paths. A published application has these files under its wwwroot, and no manifest.

public static class SerenityStaticAssets

Public Members

name description
const ManifestFileSuffix Suffix of the manifest file name, which is prefixed with the application name.
static Apply(…) Adds the asset folders in the manifest to the web root file provider of the environment. Also enables the static web assets of other projects / packages when not running in development environment, as it is only done automatically for development. Does nothing if there is no manifest, e.g. for a published application.
static CreateFileProvider(…) Creates the file provider for a manifest entry, which serves the files of the folder that match its patterns under its base path.
static GetManifestPath(…) Gets the manifest file path for the application.
static ReadManifest(…) Reads the asset folder entries from a manifest file.
static UseSerenityStaticAssets(…) Serves static assets of the packages listed in the build output manifest, see SerenityStaticAssets. Use this instead of UseStaticWebAssets(), it also enables static web assets outside the development environment.
class ManifestEntry An asset folder in the manifest, with its patterns resolved from the manifest's pattern sets. Patterns are ; separated, relative to Root, and the same ones used to select the files to publish / pack.

See Also