locked
bundles with jpg and font file not work with IIS RRS feed

  • Question

  • User497297161 posted

    I have an aspnetboilerplate application deployed in IIS (tried 8.5 and 10), there are following errors when access from chrome:

    fontawesome-webfont.woff2:1 Failed to load resource: the server responded with a status of 404 (Not Found)

    user-img-background.jpg:1 Failed to load resource: the server responded with a status of 404 (Not Found)

    fontawesome-webfont.woff:1 Failed to load resource: the server responded with a status of 404 (Not Found)

    fontawesome-webfont.ttf:1 Failed to load resource: the server responded with a status of 404 (Not Found)

     In console window of Chrome:</div> <div>there are something like:

    http://47.94.194.xx:8081/Bundles/fonts/fontawesome-webfont.woff2?v=4.6.3 404 (Not Found)

    http://47.94.194.xx:8081/Bundles/fonts/user-img-background.jpg ... 404 (Not Found)

    Below is my resource files structure:

    /Content/font-awesome.css</div> <div>/css/style.css

    /fonts/fontawesome......

    /images/user-img-background.jpg

    In style.css reference the user-img-background.jpg as below:

    background: url("../images/user-img-background.jpg") no-repeat no-repeat;

    In font-awesome.css reference those 404 font files

    I also registered the bundles in _Layout.cshtml as:

    @Styles.Render("~/Bundles/vendor/css")

    My bundleconfig is like (take style.css as example):</div> <div>bundles.Add(
    new StyleBundle("~/Bundles/vendor/css")
    ...........
    .Include("~/css/*.css", new CssRewriteUrlTransform())
    ...........
    );

    Could anyone tell why user-img-background.jpg cannot be found?

    Note: in IIS added all MIME types.

    Thanks!

    Tuesday, August 14, 2018 11:24 AM

All replies

  • User1724605321 posted

    Hi novodexx,

    I build a code sample to test :

    font-awesome.css:
    @font-face {
        font-family: 'FontAwesome';
        src: url('../fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2');
        font-weight: normal;
        font-style: normal;
    }
    style.css:
    .header-icon {
        width: 48px;
        height: 48px;
        background: url("../images/user-img-background.jpg") no-repeat no-repeat;
    }
    

    It works fine :

    Could you please provide more details or some steps to help us reproduce your problem ? 

    Best Regards,

    Nan Yu

    Wednesday, August 15, 2018 3:15 AM