0

i'm working on a project which it uses styles and scripts bundles, but when I run it locally, everything works perfectly but when I deploy it, non of style bundles render.

here is my bundle :

        bundles.Add(new StyleBundle("~/assets/bootstrap").Include(
            "~/Assets/css/bootstrap.css"
            ));

I'm wondering why is this happening after deploy?

before deploy (even in release mode) :

<link href="/assets/bootstrap?v=hU1wN6BEpBTuIe8JohSVK3KT4N99k1wLPo3p56yO0I81" rel="stylesheet">

after deploy (even in debug mode) :

<link href="/assets/bootstrap-rtl?v=" rel="stylesheet">

Update: according to answer I changed the bundle like so :

bundles.Add(new StyleBundle("~/abcdefg").Include(
    "~/Assets/css/bootstrap.css"
    ));

which I don't have a real folder named abcdefg , but it didn't make any change and still the problem persists :

<link href="/abcdefg?v=" rel="stylesheet">

so if anybody knows where's the problem or what I am doing wrong, I'll be grateful to get your helps

Hooman Limouee
  • 1,143
  • 2
  • 21
  • 43

2 Answers2

0

I believe someone already got a similar problem.

Style bundling not working after IIS deployment (MVC 4)

Make sure you have no name collision

phoenix
  • 365
  • 1
  • 4
  • 15
0

Finally I find out that the problem was because that I've forgotten to include the style files in the project before I publish it.

so I've included them and now it works like a charm.

Hooman Limouee
  • 1,143
  • 2
  • 21
  • 43