locked
How to fix 404 error in css bundles with media attribute after upgrading to VS 2013 Expess for Web RRS feed

  • Question

  • User-1262787652 posted

    ASP.NET MVC4 application index.cshtml  contains style bundles with media attributes

    <link href="@Styles.Url("~/css/pos.css")" rel="stylesheet" type="text/css" media="screen" />       
    <link href="@Styles.Url("~/css/receipt.css")" rel="stylesheet" type="text/css" media="print" />

     

    as recommended in http://stackoverflow.com/questions/12042248/make-asp-net-bundling-specify-media-screen-for-css-bundle MVC4 buildin minification and bundling are used.

    If solution is running from  VS Express 2013 for Web those links give 404 error with response

    Key Value     
    Response HTTP/1.1 404 Not Found     
    Cache-Control private     
    Content-Type text/html; charset=utf-8     
    Server Microsoft-IIS/8.0     
    X-SourceFiles =?UTF-8?B?STpccmFhbWF0XEVldmFXZWJcRWV2YS5FcnBcY3NzXHBvcy5jc3M=?=     
    Date Mon, 18 Nov 2013 16:01:30 GMT     
    Content-Length 4961
    

     

    in both debug and release modes.

    If same solution is running from Visual Studion 2012 Express, styles are retrieved properly. How to run it from VS 2013 Express For Web ? It looks like it uses II8 Express to run, maybe this causes error ?

    Monday, November 18, 2013 11:09 AM

Answers

  • User-30361504 posted

    chk below links :

    http://danielcorreia.net/blog/quick-start-to-mvc4-bundling/

    http://stackoverflow.com/questions/20052278/how-to-specify-media-type-for-css-bundle-in-vs-express-2013-for-web

    http://stackoverflow.com/questions/12042248/make-asp-net-bundling-specify-media-screen-for-css-bundle

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 22, 2013 12:52 AM

All replies

  • User-166373564 posted

    Hi kobruleht

    If solution is running from  VS Express 2013 for Web those links give 404 error with response

    This problem occurs for one or more of the following reasons:

    • Make sure that the requested resource is at the location that the URL points to.
    • Review the URL that you open in the Web browser.
    • Make sure that no custom filters or modules restrict access to the file that you want to browse.

    Please check it on your side, if it still has same issue, please don’t hesitate to let me know.

    Regards

    Angie

    Friday, November 22, 2013 12:30 AM
  • User-30361504 posted

    chk below links :

    http://danielcorreia.net/blog/quick-start-to-mvc4-bundling/

    http://stackoverflow.com/questions/20052278/how-to-specify-media-type-for-css-bundle-in-vs-express-2013-for-web

    http://stackoverflow.com/questions/12042248/make-asp-net-bundling-specify-media-screen-for-css-bundle

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 22, 2013 12:52 AM