none
Confusing issue that just makes no sense.

    Question

  • I'm not sure if this is the right area, but I think it is related to VS2015 or IIS.

    I have an MVC app that utilizes a header, sidebar, and content area.  Using bootstrap 3.0.0.  I have it set up to use IIS Express in project properties.  It looks like this... and it is exactly how I want it to look.

    Now, I don't want to use IIS Express, I would much rather use my Local IIS.  In properties, I change it, point to the URL I want to use and create virtual directory.  Save. Rebuild. Launch.  Now it looks terrible...

    Does anyone have any ideas on why the different IIS setting would change the look?

    Thanks in advance:)

    Thursday, May 5, 2016 12:03 AM

Answers

  • The reason it looks this way is because when the bundles are compiled the end result will be a reference to a CSS file using an absolute path such as:

    <link rel="stylesheet" href="/Content/css/xxxxxx.css">

    Studio is not aware of the virtual directory so it doesn't know to add this onto the path which should be:

    <link rel="stylesheet" href="/[Virtual Directory]/Content/css/xxxxxx.css">

    My advise would be to let Visual Studio do all the work as any changes to your code to compensate for this behaviour will bit you later when you install the app without the virtual directory.

    Hope this makes sense.

    Cheers,

    Paul

    Thursday, May 5, 2016 7:27 AM
  • Well.  That may be the answer.  It was at the very least helpful in getting me to look at it through the development tools for IE11.

    The problem is actually IE11.  It actually works great in Firefox, Chrome, and even Microsoft Edge.

    Thank you.

    Thursday, May 5, 2016 3:55 PM

All replies

  • It looks like the CSS for this web application has an absolute path. You will need to change this to a relative path and the problem will go away.

    If this is not the case can you post the "<head>" section of the page source.

    Cheers,

    Paul

    Thursday, May 5, 2016 12:37 AM
  • I'm a winforms guy.  So, I'm a bit fresh on the web side of things.  Here is the head block of the shared _layout page.

    Thursday, May 5, 2016 12:48 AM
  • The reason it looks this way is because when the bundles are compiled the end result will be a reference to a CSS file using an absolute path such as:

    <link rel="stylesheet" href="/Content/css/xxxxxx.css">

    Studio is not aware of the virtual directory so it doesn't know to add this onto the path which should be:

    <link rel="stylesheet" href="/[Virtual Directory]/Content/css/xxxxxx.css">

    My advise would be to let Visual Studio do all the work as any changes to your code to compensate for this behaviour will bit you later when you install the app without the virtual directory.

    Hope this makes sense.

    Cheers,

    Paul

    Thursday, May 5, 2016 7:27 AM
  • Well.  That may be the answer.  It was at the very least helpful in getting me to look at it through the development tools for IE11.

    The problem is actually IE11.  It actually works great in Firefox, Chrome, and even Microsoft Edge.

    Thank you.

    Thursday, May 5, 2016 3:55 PM
  • Hi Countrysideflair,

    I'm glad that you have find out the problem and sharing your discovery here.

    Please mark your reply as answer, which is benefit to other communities who has the same problem. If any questions in future, please feel free to come back to our forum.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, May 6, 2016 5:37 AM
    Moderator