0

Question Background:

I'm developing a site in MVC4. It uses bootstrap and I'm publishing it to Azure.

Issue:

There have been other questions on this issue but none of the suggestions have worked for me. The issue is I have changed the bootstrap.css file. I've removed a padding style on the .navbar and also changed its background colour.

These changes worked fine when loaded locally. As soon as I deploy the site to Azure the changes are not being included.

The Project Structure:

This is the structure of the Contents folder that holds the CSS in the project:

enter image description here

The Code:

This is the BundleConfig.cs for the styles on the site:

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

This is how it is being rendered in the master layout _Layout.cshtml:

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

What I have tried so far:

I have tried the following fixes but still the issue persists:

  • Ensuring the bootstrap.css is set to Copy Always:
  • Deleted the old Web App in Azure, created a new one and reployed
  • Tried changing the Style Bundles name in the Bundle file from: new StyleBundle("~/Content/css") to new StyleBundle("~/Content/bootstrapcss") and then altering the code in the @Styles.Render section to the new change.
  • Moving the CSS in the Contents folder to its own folder i.e Contents\cssfiles

Any ideas with trying to fix this frustrating issue are much appreciated!

0

2 Answers 2

3

I found this great answer located here:

CSS changes on MVC App not working

I have my project set in debug mode, and I was deploying in Release mode. Switching to Debug meant the changes in bootstrap.css were deployed.

Sign up to request clarification or add additional context in comments.

Comments

0

Confirm if the file in question is part of the deployment packaged in Visual Studio. This happened to me in the past (with web.config), as the file was not set to be part of the remote deployment package to Azure.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.