2017-11-14 3 views
0

VS2013を使用してASP.Net MVCプロジェクトを作成しています。レイアウトスタイルを作成するためにブートストラップを使用しています。私はRegisterBundlesを使って私のCSSとJSを登録しています。問題は、スタイルをうまく開発している間ですが、プロジェクトをコンパイルしてIISサーバーに送信した後で、動作しなくなり、スタイルが失われてしまうようです。私はなぜそれが起こっているのか分からない。IISにプロジェクトを送信した後、RegisterBundlesがブートストラップを失っていますか?

注意VS2013を使用してテストするプロジェクトを開始し、VS2013のIIS Expressを使用して起動すると、正常に動作しますが、コンパイルしてプロジェクトをIISサーバーに送信すると機能しなくなります。

IISで既にStatic Contentロールが有効になっていますが、それでも機能しません。

どうすればこの問題を解決できますか?

BundleConfig

public class BundleConfig{ 
     // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 
     public static void RegisterBundles(BundleCollection bundles){ 

      /************************* BOOTSTRAP ***********************************/ 
      bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
             "~/Scripts/bootstrap.js")); 

      bundles.Add(new StyleBundle("~/Content/bootstrap").Include(
             "~/Content/bootstrap.css", 
             "~/Content/bootstrap-theme.css" 
             )); 
      //********************************************************************/ 


      /******************************** DATETIME PICKER ********************/ 
      bundles.Add(new StyleBundle("~/Content/datetimepicker").Include(
             "~/Content/bootstrap-datetimepicker.css" 
             )); 
      //********************************************************************/ 


      /*************************** SELECT2 *********************************/ 
      bundles.Add(new StyleBundle("~/Content/select2").Include(
             "~/Content/select2-bootstrap.css", 
             "~/Content/select2.css"            
             )); 
      /*******************************************************************/ 


      /*************************** Lightbox Image Gallery *********************************/ 
      bundles.Add(new StyleBundle("~/Content/lightbox").Include(
             "~/Content/lightbox.css"           
             )); 
      /*******************************************************************/ 




      bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
         "~/Scripts/jquery-{version}.js")); 

      bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
         "~/Scripts/jquery-ui-{version}.js")); 

      bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
         "~/Scripts/jquery.unobtrusive*",  
         "~/Scripts/jquery.validate*",       
         "~/Scripts/CustomValidacoes.js")); 

      bundles.Add(new ScriptBundle("~/bundles/Mascaras").Include(
         "~/Scripts/Mascaras/jquery.mask.js", 
         "~/Scripts/Mascaras/Mascaras.js")); 

      //Datetimepicker 
      bundles.Add(new ScriptBundle("~/bundles/Datetimepicker").Include(
         "~/Scripts/moment.js", 
         "~/Scripts/moment-with-locales.js", 
         "~/Scripts/moment_locale_pt-br.js", 
         "~/Scripts/bootstrap-datetimepicker.js" 
         )); 

      //Lightbox 
      bundles.Add(new ScriptBundle("~/bundles/Lightbox").Include(
         "~/Scripts/lightbox.js")); 



      // Use the development version of Modernizr to develop with and learn from. Then, when you're 
      // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 
      bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
         "~/Scripts/modernizr-*")); 

      bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); 

      bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
         "~/Content/themes/base/jquery.ui.core.css", 
         "~/Content/themes/base/jquery.ui.resizable.css", 
         "~/Content/themes/base/jquery.ui.selectable.css", 
         "~/Content/themes/base/jquery.ui.accordion.css", 
         "~/Content/themes/base/jquery.ui.autocomplete.css", 
         "~/Content/themes/base/jquery.ui.button.css", 
         "~/Content/themes/base/jquery.ui.dialog.css", 
         "~/Content/themes/base/jquery.ui.slider.css", 
         "~/Content/themes/base/jquery.ui.tabs.css", 
         "~/Content/themes/base/jquery.ui.datepicker.css", 
         "~/Content/themes/base/jquery.ui.progressbar.css", 
         "~/Content/themes/base/jquery.ui.theme.css")); 



     } 
    } 

レイアウトHTML

<!DOCTYPE html> 
<html> 
<head> 
    <meta charset="utf-8" /> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    <title>@ViewBag.Title - InvestimentosUSA.com</title> 
    @Styles.Render("~/Content/css") 
    @Styles.Render("~/Content/bootstrap")  
    @Styles.Render("~/Content/CustomStyle.css") 
    @Styles.Render("~/Content/datetimepicker") 
    @Styles.Render("~/Content/select2") 
    @Styles.Render("~/Content/lightbox") 
    <script type="text/javascript" src="https://maps.google.com/maps/api/js?key=AIzaSyA8JZPv2N9bE0OQABj6hKO9QZb0kH32lHo"></script> 

</head> 
<body> 
    <!--/layout pagina principal--> 
    @Html.Partial("_Loading") 
    @Html.Partial("_Header") 
    <div class="container-fluid"> 
     <div class="row"> 
      <div class="col-md-12"> 
       @RenderBody() 
      </div>    
     </div> 
    </div> 
    @Html.Partial("_Footer") 


    @Scripts.Render("~/bundles/jquery") 
    @Scripts.Render("~/bundles/bootstrap") 
    @Scripts.Render("~/bundles/modernizr") 

    @Scripts.Render("~/Scripts/PersistObjects/Usuarios/LoginUsuario.js") 
    @RenderSection("scripts", required: false) 
</body> 
</html> 

答えて

0

私は問題を解決しました。私はリリース時にコンパイルしていたので、それが起こっていたし、私はデバッグでコンパイルして、それは最終的に私が望むように働いた。

関連する問題