我们最近将项目从MVC 3升级到了MVC 4.我们的目标是.NET 4.0框架,我们的Web应用程序是32位由于我们必须包括一些参考。64位IIS 7.5服务器上的ASP.NET/MVC 4捆绑和缩小404问题
我们遇到的问题是,我们将捆绑/缩小从Chirpy转换为内置ASP.NET捆绑。该网站在运行ONLY .NET 4.0的32位服务器,Windows Server 2003/IIS 6和2008/IIS 7.5以及我们的64位开发计算机上都没有问题。上述所有捆绑/缩小工作都很好。
在安装了ONLY .NET 4.0的64位Windows 2008/IIS 7.5服务器上,捆绑不起作用。我们为生成的脚本和样式获取了404错误。
如果我们在64位服务器上安装.NET 4.5,它工作正常。我们对此感到困惑,因为有些服务器在没有.NET 4.5的情况下工作,而这需要它。最重要的是,Windows Server 2003/64位与.NET 4.5不兼容,所以如果出现问题,此修补程序将不起作用。
奇怪的是,以.NET 4.0为基础构建x86的示例MVC 4示例互联网应用在问题服务器上工作正常,只有4.0。 web.config除了统一,日志记录,elmah和无点配置以外完全相同。
任何帮助,这将不胜感激。
这里的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"));
}
}
}
下面是我们如何引用我们的布局包:
@Scripts.Render("~/bundles/WebApp.Main")
<link href="@Url.Content("~/Content/SiteLess.less")" rel="stylesheet" type="text/css" />
@Styles.Render("~/bundles/Content/WebApp.Main")
...
编辑:响应/更新
- 是的,已启用的32位应用程序标志在应用程序池中设置为True。
- 来,让404看起来像这样http://xx.xx.xx.xxx/WebApp/bundles/WebApp.Main?v=03pBc7hdH1lHLtZGx-JMosNaLpMK7fcmI0uI6auknHw1
- Windows事件查看器请求的路径显示什么
- 它可以安装.NET 4.5,卸载它,然后再重新安装后.NET 4.0
- 它的工作原理上的企业2008 64位服务器。问题服务器是标准版。我们将重建虚拟机以查看是否解决了这个问题。
这可能有助于http://forums.asp.net/t/1846749.aspx/2/10?Published+MVC+web+to+IIS7+in+Windows+Server+2008+doesn+t+serve+捆绑 – Jack 2013-02-21 23:41:09
发布您的BudleConfig.cs请 – CrazyCoderz 2013-02-22 11:57:04
@Jack谢谢,我们通读了该主题,并提出了更改建议,但它没有帮助。在64位机器上安装.NET 4.0和.NET 4.5后,Ours实际上可以正常工作。我不认为.NET 4.5是必需的。 – Dustin 2013-02-22 14:03:25