Я начал проект с помощью шаблона «Веб-API» в Visual Studio. Однако проект начал расти, и мне нужно было создать веб-сайт. При локальном запуске все функции верны, но как только я публикую sh сайт в Azure, стили CSS не распознаются.
Вот мой Bootstrap каталог:
And here is the code for my Bundle class:
public static class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/Content/Scripts/jquery").Include(
"~/Content/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/Content/Scripts/modernizr").Include(
"~/Content/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/Content/Scripts/bootstrap").Include(
"~/Content/Scripts/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/css/bootstrap.css",
"~/Content/css/site.css"));
}
}
The primary layout is the following:
<!DOCTYPE html>
...
@Styles.Render("~/Content/css")
@Scripts.Render("~/Content/Scripts/modernizr")
... @RenderBody () ... @ Scripts.Render ("~ / Content / Scripts / jquery") @ Scripts.Render ("~ / Content / Scripts / bootstrap ")