ASP.NET / MVC 4捆绑和缩小404问题在64位IIS 7.5服务器 [英] ASP.NET / MVC 4 bundling and minification 404 issues on 64-bit IIS 7.5 server

查看:145
本文介绍了ASP.NET / MVC 4捆绑和缩小404问题在64位IIS 7.5服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近升级我们的项目从MVC 3至4 MVC是我们面向.NET 4.0框架,我们的Web应用程序是32位的,由于一些参考,我们必须有。

We recently upgraded our project from MVC 3 to MVC 4. We are targeting the .NET 4.0 framework, and our web app is 32-bit due to some references we have to include.

我们遇到的问题是,我们转换我们的捆绑/从微小到扢内置的ASP.NET捆绑。该网站对32位服务器没有问题,运行,无论是在Windows Server 2003 / IIS 6和2008 / IIS 7.5只运行.NET 4.0,而我们的64位开发机。捆绑/缩小正常工作在上述所有。

The problem we are having is that we converted our bundling / minification from Chirpy to the built-in ASP.NET bundling. The site runs with no problems on 32-bit servers, both Windows Server 2003/IIS 6 and 2008/IIS 7.5 running ONLY .NET 4.0, and our 64-bit development machines. The bundling / minification works fine on all of the above.

在64位Windows 2008 / IIS 7.5服务器只安装了.NET 4.0,捆绑不起作用。我们获取生成的脚本和样式都404错误。

On a 64-bit Windows 2008 / IIS 7.5 server with ONLY .NET 4.0 installed, bundling does not work. We get 404 errors for both the generated scripts and styles.

如果我们在64位服务器上安装.NET 4.5,它工作正常。我们对此感到困惑,因为一些服务器,而.NET 4.5的工作,而这一次需要它。最重要的是,Windows Server 2003的/ 64位不兼容.NET 4.5,所以如果有一个问题为好,此修复程序将无法正常工作。

If we install .NET 4.5 on the 64-bit server, it works fine. We are confused by this because some servers work without .NET 4.5, and this one requires it. On top of that, Windows Server 2003 / 64-bit is not compatible with .NET 4.5 so if that has an issue as well, this fix won't work.

奇怪的是,样本MVC 4样品互联网应用定位.NET 4.0内置的x86工作正常,只有4.0问题的服务器上。在web.config正是除了统一一样,测井,ELMAH,并点更少的配置。

The weird thing is, the sample MVC 4 sample internet app targeting .NET 4.0 built x86 works fine with just 4.0 on the problem server. The web.config is exactly the same except for unity, logging, elmah, and dot less configuration.

任何帮助,这将是非常美联社preciated。

Any help with this would be much appreciated.

这里的BundleConfig.cs:

Here's the BundleConfig.cs:

using System.Web;
using System.Web.Optimization;

namespace WebApp
{
    public class BundleConfig
    {
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.UseCdn = false;

            // .debug.js, -vsdoc.js and .intellisense.js files 
            // are in BundleTable.Bundles.IgnoreList by default.
            // Clear out the list and add back the ones we want to ignore.
            // Don't add back .debug.js.
            bundles.IgnoreList.Clear();
            bundles.IgnoreList.Ignore("*-vsdoc.js");
            bundles.IgnoreList.Ignore("*intellisense.js");

            bundles.Add((new ScriptBundle("~/bundles/WebApp.Register1")).Include("~/Scripts/jquery.ba-tinypubsub.min.js",       
                                                                                 "~/Scripts/knockout-2.1.0.js",
                                                                                 "~/Scripts/WebApp/WebApp.Register.RegisterStudent.js",
                                                                                 "~/Scripts/WebApp/WebApp.Register.RegisterPresenter.js"));

            bundles.Add((new Bundle("~/bundles/WebApp.Register2")).Include("~/Scripts/WebApp/WebApp.Register.StudentSelect.js"));


            bundles.Add((new ScriptBundle("~/bundles/WebApp.View1")).Include("~/Scripts/jquery.ba-tinypubsub.min.js",
                                                                             "~/Scripts/WebApp/WebApp.View.ImagePresenter.js", 
                                                                             "~/Scripts/WebApp/WebApp.View.ImageResults.js"));

            bundles.Add((new Bundle("~/bundles/WebApp.View2")).Include("~/Scripts/WebApp/WebApp.View.StudentsSelect.js"));

            bundles.Add((new ScriptBundle("~/bundles/WebApp.Print1")).Include("~/Scripts/WebApp/WebApp.Print.SelectedIdArray.js",
                                                                              "~/Scripts/jquery.ba-tinypubsub.min.js",
                                                                              "~/Scripts/WebApp/WebApp.Print.DocumentsSelect.js",
                                                                              "~/Scripts/WebApp/WebApp.Print.DocumentsSelected.js",
                                                                              "~/Scripts/WebApp/WebApp.Print.DocumentsPresenter.js",
                                                                              "~/Scripts/WebApp/WebApp.Print.StudentsPresenter.js",
                                                                              "~/Scripts/WebApp/WebApp.Print.PrinterSelected.js",
                                                                              "~/Scripts/WebApp/WebApp.Print.OutputSummary.js",
                                                                              "~/Scripts/WebApp/WebApp.Print.OutputPresenter.js",
                                                                              "~/Scripts/WebApp/WebApp.Print.NoStudentPresenter.js"));

            bundles.Add((new Bundle("~/bundles/WebApp.Print2")).Include("~/Scripts/WebApp/WebApp.Print.StudentsSelect.js",
                                                                        "~/Scripts/WebApp/WebApp.Print.StudentsSelected.js"));

            bundles.Add((new ScriptBundle("~/bundles/WebApp.Main")).Include("~/Scripts/modernizr.custom.33607.js", 
                                                                            "~/Scripts/jquery-1.6.1.js",
                                                                            "~/Scripts/jquery-ui-1.8.10.custom.min.js",
                                                                            "~/Scripts/jquery-ui.min.js", 
                                                                            "~/Scripts/json.js",
                                                                            "~/Scripts/jquery.validate.min.js", 
                                                                            "~/Scripts/jquery.marquee.js",
                                                                            "~/Scripts/YUI.js", 
                                                                            "~/Scripts/Common.SearchHighlight.js"));

            bundles.Add((new StyleBundle("~/bundles/Content/WebApp.Main")).Include("~/Content/jquery.marquee.min.css",
                                                                                      "~/Content/YUI.css", 
                                                                                      "~/Content/Site.css",
                                                                                      "~/Content/ui-lightness/jquery-ui-1.8.10.custom.css"));
        }
    }
}

下面是我们如何引用我们的布局包:

Here's how we're referencing the bundles in our layout:

    @Scripts.Render("~/bundles/WebApp.Main")
    <link href="@Url.Content("~/Content/SiteLess.less")" rel="stylesheet" type="text/css"  />
    @Styles.Render("~/bundles/Content/WebApp.Main")
    ...

编辑:响应/更新

Responses / updates


  • 是,已启用32位应用程序标志设置为True应用程序池。

  • 来,让404请求的路径看起来像这样的http://xx.xx.xx.xxx/WebApp/bundles/WebApp.Main?v=03pBc7hdH1lHLtZGx-JMosNaLpMK7fcmI0uI6auknHw1

  • Windows事件查看器显示什么

  • 它的工作原理安装.NET 4.5,卸载它,然后再重新安装.NET 4.0后,

  • 它的工作原理的企业2008年的64位服务器上。问题服务器是标准版。我们要重建虚拟机,看看是否能解决问题。

推荐答案

这个问题似乎是与虚拟机上的.NET 4.0的安装,我们正在使用该服务器。用干净的.NET 4.0的安装创造了两个新的虚拟机(在Windows 2008 64位,一个标准一体的企业)后,捆绑上都工作正常。感谢所有帮助。

The issue appears to be with the .NET 4.0 installation on the VM we were using for that server. After creating two new VMs (both Windows 2008 64-bit, one standard one enterprise) with clean .NET 4.0 installs, the bundling worked fine on both. Thanks for all the help.

这篇关于ASP.NET / MVC 4捆绑和缩小404问题在64位IIS 7.5服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆