This project has moved and is read-only. For the latest updates, please go here.

Bundled "file" does not exist in the server

May 15, 2015 at 12:02 PM
I deployed my project to a single server.
It was working perfectly locally, in both ways, bundling or not
(setting debug=true or false in the web.config)

In the server though, bundle transformer is apparently doing its job, generating the bundled link but that link does not exist in the server, I get an error 404 when try to access the link.

If I set debug=true in my web.config in the server, the correct files are being listed and it works, which makes me assuming this is not a code issue, maybe some configuration or installation missing.

That's my web.config in the server:
    <sectionGroup name="bundleTransformer">
          <section name="core" type="BundleTransformer.Core.Configuration.CoreSettings, BundleTransformer.Core" />
          <section name="yui" type="BundleTransformer.Yui.Configuration.YuiSettings, BundleTransformer.Yui" />
<bundleTransformer xmlns="">
            <css defaultMinifier="YuiCssMinifier">
                    <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="true" />
                    <add name="UrlRewritingCssPostProcessor" type="BundleTransformer.Core.PostProcessors.UrlRewritingCssPostProcessor, BundleTransformer.Core" useInDebugMode="false" />
                    <add name="YuiCssMinifier" type="BundleTransformer.Yui.Minifiers.YuiCssMinifier, BundleTransformer.Yui" />
                    <add fileExtension=".css" assetTypeCode="Css" />
            <js defaultMinifier="YuiJsMinifier">
          <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="true" />
          <add name="YuiJsMinifier" type="BundleTransformer.Yui.Minifiers.YuiJsMinifier, BundleTransformer.Yui" />
          <add fileExtension=".js" assetTypeCode="JavaScript" />
That's my BundleConfig.cs, RegisterBundle method:
           BundleResolver.Current = new CustomBundleResolver();
            var nullBuilder = new NullBuilder();
            var styleTransformer = new StyleTransformer();
            var scriptTransformer = new ScriptTransformer();
            var nullOrderer = new NullOrderer();
            var companycss = new CustomStyleBundle("~/bundlesCSSJS/Company.css");
            companycss.Builder = nullBuilder;
            companycss.Orderer = nullOrderer;
That's what my Master Page have:
    <%= Styles.Render("~/bundlesCSSJS/Company.css")%>
That's the result when debug=true, everything works fine here:
<link href="/Scripts/bootstrap/css/bootstrap.css?bundleVirtualPath=%7e%2fbundlesCSSJS%2fCompany.css" rel="stylesheet">
<link href="/Scripts/bootstrap/css/bootstrap-theme.css?bundleVirtualPath=%7e%2fbundlesCSSJS%2fCompany.css" rel="stylesheet">
<link href="/Scripts/yamm/yamm.css?bundleVirtualPath=%7e%2fbundlesCSSJS%2fCompany.css" rel="stylesheet">
<link href="/Scripts/magiczoomplus.v4.5/magiczoomplus.css?bundleVirtualPath=%7e%2fbundlesCSSJS%2fCompany.css" rel="stylesheet">
<link href="/App_Themes/Company/template.css?bundleVirtualPath=%7e%2fbundlesCSSJS%2fCompany.css" rel="stylesheet">
That's the result when debug=false, but that link does not exist:
<link href="/bundlesCSSJS/Company.css?v=yZ_YnEzfdtMlo2Z-00g_2PX_o_NL_7mB_fEgJfWGg1k1" rel="stylesheet">
Any idea why this is happening?
Have you seen that before?
Does the server require some internet access? Some extra dll?
By the way, I am not using LESS or SASS.

Thank you,
May 15, 2015 at 12:16 PM
Try to remove a file extension from the bundle virtual path (instead ~/bundlesCSSJS/Company.css try ~/bundlesCSSJS/CompanyStyles).

And remove the following lines:
companycss.Builder = nullBuilder;
Because CustomStyleBundle already includes instances of StyleTransformer and NullBuilder classes.
May 15, 2015 at 2:32 PM
Thanks for your reply.
It worked locally, so I will give it a try on the server later today.