Mister Epic Mister Epic - 6 months ago 76
ASP.NET (C#) Question

Environment tag helper

I'm working with Visual Studio 15 RC, and I noticed in the _Layout.cshtml, there is a new

tag helper:

<environment names="Development">
<link rel="stylesheet" href="~/css/bootstrap.css" />
<environment names="Staging,Production">
<link rel="stylesheet" href="//ajax.aspnetcdn.com/ajax/bootstrap/3.0.0/css/bootstrap.min.css"
asp-fallback-test-class="hidden" asp-fallback-test-property="visibility" asp-fallback-test-value="hidden" />

How would I indicate that that I want a
build to get the CSS files from the CDN?

Answer Source

If you want to specify Staging environment for your build :

  • Open your project properties
  • Select the Debug tab
  • In the Environment variables section, if a variable named ASPNET_ENV doesn't exist then add it by clicking to the add button. After that set the value of the variable to Staging by double-clicking in the cell.

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download