2017-07-06 4 views
2

web.configのデバッグフラグがtrueに設定されていると、次のエラーが表示されるのはなぜですか?ASP.NetバンドルによるHTTPSエラーの発生

混在したコンテンツ: 'https://example.com/' でのページが HTTPS経由でロードされますが、安全でないスクリプト 'http://example.com/scripts/base/?v=JeAlpXPCZh9gYv4U-X7_HSaAX3Fj3sGBjwukxEaloQU1' を要求しました。生成された

バンドル

bundles.Add(new ScriptBundle("~/scripts/base").Include(
    "~/Scripts/Base/app.module.js", 
    "~/Scripts/Home/home.controller.js", 
    "~/Scripts/Home/about.controller.js", 
    "~/Scripts/App/Common/dictionary.class.js", 
    "~/Scripts/App/Common/constants.class.js", 
    "~/Scripts/App/Common/multiselect.directive.js", 
    "~/Scripts/App/Common/paginationOptions.class.js", 
    "~/Scripts/App/Common/gridHeight.directive.js", 
    "~/Scripts/App/Common/utility.service.js", 
    "~/Scripts/App/Common/dateToString.directive.js", 
    "~/Scripts/App/Common/base.controller.js", 
    "~/Scripts/App/Common/messagePopover.controller.js" 
)); 

HTML

<script src="/scripts/base?v=JeAlpXPCZh9gYv4U-X7_HSaAX3Fj3sGBjwukxEaloQU1"></script> 

答えて

1

私は今朝、同様の問題がありました。私が設定した仮想パスは、スクリプトを含むフォルダ構造と同じで、仮想フォルダパスの名前を変更すると、スクリプトバンドルはhttpsで要求されていました。

スクリプトバンドルの仮想パスを次のように変更してみてください。

bundles.Add(new ScriptBundle("~/scripts/applicationBase").Include(
"~/Scripts/Base/app.module.js", 
...., 
.... 
)); 

私は私のバンドルの仮想パスに `/ virtual`を追加し、動作するように見えた

+0

に役立ちます願っています。ありがとう! – Homer

関連する問題