# App.Version — which version of your app is running, on which platform release

> `App.Version` is the version of your app that is answering ("1.0.8") and `App.PlatformVersion` the platform release serving it ("0.17.3"). Both are strings, never null, the same in a server function and on a page, and "dev" when there is no release or version. `ShowVersion = true` on an `AppChrome` shows them in the shell's brand (`WorkbenchShell`: at the end of its status line).

<!-- id: stdlib-app-version · area: stdlib · stability: preview · html: https://osysharp.com/reference/stdlib/app-version/ -->

## Summary        {#summary}

Two read-only strings that say what is running — for a footer, an "about" box, a support mail, or the shell's brand:

```osy title="say which versions are running" test app=stdlib-app-version
string AboutLine() => "Version " + App.Version + " · platform " + App.PlatformVersion;

[Route("/about")]
[AllowAnonymous]
component About() {
  render { Text(AboutLine()); }
}
```

## Signature      {#signature}

```osy syntax
string App.Version           // "1.0.8" — the app version answering; "dev" when the session serves no version
string App.PlatformVersion   // "0.17.3" — the platform release serving it; "dev" for an unreleased build
```

## Description    {#description}

### Which version is it?        {#which}

`App.Version` is the version whose model is answering the request. Deployed, that is the version the environment
serves: a production environment still on `1.0.7` while staging runs `1.0.8` reads `1.0.7` in production and `1.0.8`
in staging, even though `1.0.8` is newer. On a local platform it is the version your last `osy compile` minted there —
that instance's own number, which is what is running on it.

`App.PlatformVersion` is the platform release serving the app — `0.17.3`. A platform built from source rather than
released (a local platform, a trunk build) says `dev`, never a made-up number.

### Server and browser agree        {#parity}

Both are answered in-process on either side: a server function reads them from the session serving it, a page from
the values its boot data carries, which come from the same place. They need no `[Server]` call, no round trip and no
permission: a version is not a secret.

### Show it in the shell        {#shell}

Every shell built on `AppChrome` draws them when you ask: `ShowVersion = true` puts the app version after the
tagline and the platform release on a small line beneath it — `factory · 1.0.8` over `platform 0.17.3`. Off by
default: the people running an app want it, its readers mostly do not. `WorkbenchShell`, whose brand is a bare
mark, puts the same two lines at the far end of its status line instead.

```osy title="the version in a sidebar's brand" test app=stdlib-app-version-shell
[Layout]
[AllowAnonymous]
component Shell() {
  render {
    SidebarShell(new AppChrome {
      Product = "Lantern", Tagline = "workshop", ShowVersion = true, Home = "/",
      Nav = [ new NavItem { Label = "Home", To = "/", Icon = Icons.Home } ],
    }) { Outlet(); }
  }
}

[Route("/")]
[AllowAnonymous]
component Home() {
  render { Text("Welcome"); }
}
```

## Examples       {#examples}
```osy title="the values are always there" run app=stdlib-app-version
[Test]
void A_version_is_always_named() {
  Assert.NotEqual("", App.Version);
  Assert.NotEqual("", App.PlatformVersion);
  Assert.Equal("Version " + App.Version + " · platform " + App.PlatformVersion, AboutLine());
}
```

## See also       {#see-also}
- [App.BaseUrl — the address your app is known by, for links in mail and background work](https://osysharp.com/reference/stdlib/app-address/) — the app's address: `App.BaseUrl`, `App.Domain`, `App.Slug`
- [Environment — the app's own variables](https://osysharp.com/reference/stdlib/environment/) — `Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")`: development or production
- [The standard library — and where each call runs](https://osysharp.com/reference/stdlib/index/) — the rest of the standard library
