------------- Layout.cshtml -------------
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Title</title>
@this.Html.Partial("BundleStylesFile")
@this.RenderSection("Styles", required: false)
</head>
<body>
html code
@this.Html.Partial("BundleScriptsFile")
@this.RenderSection("Scripts", required: false)
<script>
...
</script>
</body>
</html>
------------- BundleStylesFile.cshtml -------------
<environment names="@EnvironmentName.Development">
<link rel="stylesheet" href="~/css/bootstrap/bootstrap.css" asp-append-version="true" />
...
</environment>
<environment names="@EnvironmentName.Staging,@EnvironmentName.Production">
<link rel="stylesheet" href="~/css/bootstrap/bootstrap.min.css" asp-append-version="true" />
...
</environment>
------------- BundleScriptsFile.cshtml -------------
<environment names="@EnvironmentName.Development">
<script src="~/js/bootstrap/bootstrap.js" asp-append-version="true"></script>
...
</environment>
<environment names="@EnvironmentName.Staging,@EnvironmentName.Production">
<script src="~/js/bootstrap/bootstrap.min.js" asp-append-version="true"></script>
...
</environment>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Title</title>
@this.Html.Partial("BundleStylesFile")
@this.RenderSection("Styles", required: false)
</head>
<body>
html code
@this.Html.Partial("BundleScriptsFile")
@this.RenderSection("Scripts", required: false)
<script>
...
</script>
</body>
</html>
------------- BundleStylesFile.cshtml -------------
<environment names="@EnvironmentName.Development">
<link rel="stylesheet" href="~/css/bootstrap/bootstrap.css" asp-append-version="true" />
...
</environment>
<environment names="@EnvironmentName.Staging,@EnvironmentName.Production">
<link rel="stylesheet" href="~/css/bootstrap/bootstrap.min.css" asp-append-version="true" />
...
</environment>
------------- BundleScriptsFile.cshtml -------------
<environment names="@EnvironmentName.Development">
<script src="~/js/bootstrap/bootstrap.js" asp-append-version="true"></script>
...
</environment>
<environment names="@EnvironmentName.Staging,@EnvironmentName.Production">
<script src="~/js/bootstrap/bootstrap.min.js" asp-append-version="true"></script>
...
</environment>