E
E
eRKa2016-02-29 13:31:40
ASP.NET
eRKa, 2016-02-29 13:31:40

Why might the MVC 5 bundle not work?

There is a standard bundle

bundles.Add(new StyleBundle("~/Content/css").Include(
                      "~/Content/bootstrap.css",
                      "~/Content/site.css"));

Have your own bundle
bundles.Add(new StyleBundle("~/Content/landing-css").Include(
                      "~/Content/bootstrap.css",
                      "~/Content/css/landing.css"));

Everything is standard in the template.
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title – приложение ASP.NET</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")

</head>

And below
@Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")

In the index view, where the landing is located at the bottom, I add At what point the main bundle in the template stopped working, I don’t know: the page with the landing is displayed normally, the template header works as expected. But on the rest of the pages, where the main standard style should be, there are no styles. Moreover, the next rollbacks also do not help, at what point it broke, it is not clear. I comment on my bundle, nothing changes. Already compared, with the standard created project, everything seems to be the same. According to my experiment with committing, it turns out that bootstrap styles do not pull "~/Content/bootstrap.css". I double-checked everything, the files are in place, and my bundle pulls it up. In general, I'm lost and have no imagination, what else could be the reason.
@Styles.Render("~/Content/landing-css")

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
eRKa, 2016-02-29
@kttotto

The question is removed. After it turned out that the branch was working fine for my colleagues, I climbed through several of my branches, trying to figure out exactly where it glitched, and then it magically worked. What exactly was wrong remained a mystery, apparently a studio glitch. It's a pity that the day was spent searching for something incomprehensible.

V
V Sh., 2016-02-29
@JuniorNoobie

Good afternoon! Have you looked at the html code of the generated page? Does it display all the styles it should?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question