Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Environment tag helper

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

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

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

like image 361
Mister Epic Avatar asked Sep 27 '22 23:09

Mister Epic


1 Answers

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 ASPNETCORE_ENVIRONMENT 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

like image 130
CodeNotFound Avatar answered Nov 15 '22 08:11

CodeNotFound