欧美一区二区三区,国内熟女精品熟女A片视频小说,日本av网,小鲜肉男男GAY做受XXX网站

發布網站不會更新我的CSS包

謝彥文2年前8瀏覽0評論

當我在發布模式下從Visual Studio運行我的代碼,并檢查綁定的樣式表時,我可以看到我對該綁定中的css文件的更新。然而,當我將網站發布到服務器或我的本地機器時,我在樣式表中的更改還沒有生效。捆綁的樣式表還是老的那個。

我嘗試了一個IIS重置,一個干凈的構建/重建,刪除了IIS文件夾中的所有文件并重新發布。

如果有什么不同的話,我現在用的更少了。

我的捆綁包配置:

bundles.Add(new StyleBundle("~/bundles/requiredStyles").Include(
    "~/Content/Style/Libs/bootstrap.min.css",
    "~/Content/Style/Libs/font-awesome.min.css",
    "~/Content/Style/Globals/application.css",
    "/Content/Style/Libs/muliDropdown.css",
    "~/Content/Style/Libs/smoothDivScroll.min.css",
    "~/Content/Style/Libs/jasny-bootstrap.min.css"
));

我通過訪問http://www.mywebsite.com/bundles/requiredStyles來檢查捆綁的css

所以我在application.css中做了一個更改,如果我在visual studio中(在發布模式下)點擊play,這沒有問題,但是當我發布到我的本地IIS時,我的更改不再存在。

如果css文件的縮小版本與未縮小的文件位于同一目錄中,就會發生這種情況。

例如,如果您有以下文件:

~/Content/bootstrap.css
    ~/Content/bootstrap.min.css

in your directory, and you register the "bootstrap.css" file in your bundle, the optimizer will first attempt to use the "bootstrap.min.css" file during publish. If you only updated the "bootstrap.css" file and did not update the "bootstrap.min.css" file, you will get the old styles from "bootstrap.min.css". You can fix this problem by deleting the "bootstrap.min.css" file or by updating it.

This does not happen in a debug build because it does not pull the minified files if your compilation is set for debug using the following:

<system.web>
    <compilation debug="true" />
    <!-- Lines removed for clarity. -->
</system.web>

您也可以通過以下方式禁用優化來覆蓋web.config設置:

BundleTable.EnableOptimizations = false;

This would go inside your BundleConfig.cs file.

In my case bootstrap.min.css also exists in content folder which I removed it and web site working fine.

as per Filip Stanek mentioned "the optimizer will first attempt to use the "bootstrap.min.css" file during publish"

even if we didnt add it in bundle config while publishing code it point to "bootstrap.min.css"

I recently encountered a similar issue with bundling. I use angularJS in a webapi project in visual studio.

My web.config had debug set to true. I set it to false. No change.

Then I tried setting my compiler conditions to true (in global.asax.cs|app...start method):

'#if DEBUG'
        'BundleTable.EnableOptimizations = true;'
'#else'
        'BundleTable.EnableOptimizations = true;'   
'#endif'

這也不起作用。

最后,我移動了被引用/丟失的文件(a & lt控制器名& gt。js)移動到堆棧中的另一個位置。當我調試時,我取消了包中文件的注釋,因為我將它直接包含在index.html中。有可能我恢復的時候VS沒有編譯這個改動。

' bundles.Add(new ScriptBundle("~/SomeBundleName.js")
           .Include("~/Scripts/IWASMissingIntheBundle.js")
           .Include("~/Scripts/IWASNEVERMISSINGANDstillhere.js")
           .Include("~/Scripts/MOVEDIWASMissingHEREANDNOWImFound.js")'

我的主張是,編譯器沒有接受改變,不管清理和重建仍然沒有。移動文件并重新發布后,它似乎工作。

而且我還清除了瀏覽器中的緩存,不僅僅是從& quot清除緩存& quot我在Chrome中使用的按鈕,也可以從調試器|網絡面板中使用。以上步驟應該會有所幫助。