Scenario contact: @javiercn
Scenario
The EnvironmentView component renders its child content only when the current hosting environment matches its Include and Exclude parameters, following the same semantics as the environment tag helper in MVC and Razor Pages. This validates the matching rules, that hidden content is genuinely absent rather than merely styled out, and that each hosting model reports the environment you expect it to.
Minimum build
.NET 11 Preview 7 or later.
Configurations to cover
Also exercise
What to build
A page and a shared layout that between them use EnvironmentView for four kinds of content: something shown only while developing, something shown in any pre-production environment, something hidden in production but shown everywhere else, and something shown only in production. Put at least one in the layout so it appears on every page, and make each visually obvious so you can tell at a glance which rendered.
Also display the current environment name on the page, so you can compare what you configured against what the app reports.
Things to try
- Running under
Development, Production, and your own environment name.
- An environment name written in a different case than the one the app is running under.
- Extra spaces around the names in a comma-separated list.
- The same environment named in both
Include and Exclude on one block.
- An empty
Include list, and a block with neither parameter.
- Nesting one
EnvironmentView inside another.
- Publishing the app and running the published output, especially for standalone WebAssembly.
- Giving the client project a different environment than the server, then reloading.
- In Interactive Auto, the first visit and then a reload once the app has been cached.
Expected behavior
Content appears only in the environments it was declared for. Comma-separated lists accept several names with surrounding whitespace ignored, and names match regardless of case. Where an environment is both included and excluded, the exclusion wins. Content that should be hidden is absent from the markup rather than hidden with CSS. Each hosting model reports the environment its own configuration gives it.
Must hold
- Content restricted to an environment renders in that environment and is absent from the page source in every other one, rather than present but hidden.
- An environment name written in a different case than the running environment still matches.
- Names separated by commas with surrounding spaces all match.
- An environment named in both
Include and Exclude renders nothing.
- A block with an empty
Include list, and a block with neither parameter, both render in every environment.
- Where the client project is configured with a different environment than the server, the content left on screen once the component is interactive matches the environment the client reports.
Expected differences between configurations
- A published standalone WebAssembly app takes its environment from the host serving it and reports
Production unless that host says otherwise, so environment-dependent content can differ between running locally and running from a published deployment.
- In Interactive Auto the first visit renders on the server and later visits render in the browser, so if the two sides are configured with different environments the same page shows different content before and after the app is cached.
Documentation to use
What to report
Report results using the format described in the validation testing manual. Include link to a repository with the test app.
Scenario contact: @javiercn
Scenario
The
EnvironmentViewcomponent renders its child content only when the current hosting environment matches itsIncludeandExcludeparameters, following the same semantics as theenvironmenttag helper in MVC and Razor Pages. This validates the matching rules, that hidden content is genuinely absent rather than merely styled out, and that each hosting model reports the environment you expect it to.Minimum build
.NET 11 Preview 7 or later.
Configurations to cover
Also exercise
What to build
A page and a shared layout that between them use
EnvironmentViewfor four kinds of content: something shown only while developing, something shown in any pre-production environment, something hidden in production but shown everywhere else, and something shown only in production. Put at least one in the layout so it appears on every page, and make each visually obvious so you can tell at a glance which rendered.Also display the current environment name on the page, so you can compare what you configured against what the app reports.
Things to try
Development,Production, and your own environment name.IncludeandExcludeon one block.Includelist, and a block with neither parameter.EnvironmentViewinside another.Expected behavior
Content appears only in the environments it was declared for. Comma-separated lists accept several names with surrounding whitespace ignored, and names match regardless of case. Where an environment is both included and excluded, the exclusion wins. Content that should be hidden is absent from the markup rather than hidden with CSS. Each hosting model reports the environment its own configuration gives it.
Must hold
IncludeandExcluderenders nothing.Includelist, and a block with neither parameter, both render in every environment.Expected differences between configurations
Productionunless that host says otherwise, so environment-dependent content can differ between running locally and running from a published deployment.Documentation to use
What to report
Report results using the format described in the validation testing manual. Include link to a repository with the test app.