1

it, so that now I can not get my style to be displayed on the page. it just comes up with this stuff in my html.

I've tried to look here MVC bundeling : Err 403

<link href="/Content/?v=QJxA7R8Re3uqMX1yrXXxo93tvLZiLQJPzVSY80tOo9s1" rel="stylesheet">
<link href="/Content/skins/?v=cvum26wsOdSFqp48CXFJ39rlGKOSzsCvOJZuuLeX4901" rel="stylesheet">

_Layout.cshtml

@Styles.Render("~/Content/")
@Styles.Render("~/Content/skins/")

BundleConfig.cs

public static void RegisterBundles(BundleCollection bundles)
    {
        bundles.Add(new StyleBundle("~/Content/skins/").Include(
                  "~/Content/skins/default.css"));

        bundles.Add(new StyleBundle("~/Content/").Include(
                  "~/Content/theme.css",
                  "~/Content/theme-*"));
    }

It gives me this one error. enter image description here

That's my folder here.

enter image description here

EIDT (Update)

BundleConfig.cs

public static void RegisterBundles(BundleCollection bundles)
    {
        bundles.Add(new StyleBundle("~/bundle/skins").Include(
                  "~/Content/skins/default.css"));

        bundles.Add(new StyleBundle("~/bundle/Content")
            .Include("~/Content/theme.css")
            .Include("~/Content/theme-blog.css")
            .Include("~/Content/theme-animate.css")
            .Include("~/Content/theme-elements.css"));

        bundles.Add(new StyleBundle("~/bundle/Scripts")
            .Include("~/Scripts/bootstrap/bootstrap.min.css")
            .Include("~/Scripts/owlcarousel/owl.carousel.min.css")
            .Include("~/Scripts/owlcarousel/owl.theme.default.min.css")
            .Include("~/Scripts/magnific-popup/magnific-popup.css"));
    }

Layout.cshtml

@Styles.Render("~/bundle/Content")
@Styles.Render("~/bundle/skins")
@Styles.Render("~/bundle/Scripts")
Community
  • 1
  • 1

1 Answers1

2

Your issue is that the name that you have given the bundles are the same as an existing folder in your solution.

The fix is to change the name of your bundles so that they don't clash with existing folders.

For example, instead of ~/Content/skins use ~/bundle/skins:

public static void RegisterBundles(BundleCollection bundles)
{
    bundles.Add(new StyleBundle("~/bundle/skins").Include(
              "~/Content/skins/default.css"));
}

Then:

@Styles.Render("~/bundle/skins")
Brendan Green
  • 11,676
  • 5
  • 44
  • 76