Abbiamo recentemente aggiornato il nostro progetto da MVC 3 a MVC 4. Ci stiamo occupando del framework .NET 4.0 e la nostra app Web è a 32 bit a causa di alcuni riferimenti che dobbiamo includere.ASP.NET/MVC 4 bundling e minification 404 problemi su server IIS 7.5 a 64 bit
Il problema che stiamo avendo è che abbiamo convertito il nostro bundling/minification da Chirpy al bundle ASP.NET integrato. Il sito viene eseguito senza problemi sui server a 32 bit, sia Windows Server 2003/IIS 6 e 2008/IIS 7.5 che eseguono SOLO .NET 4.0, sia le nostre macchine di sviluppo a 64 bit. Il bundling/minification funziona bene su tutto quanto sopra.
Su un server Windows 2008/IIS 7.5 a 64 bit con installato SOLO .NET 4.0, il raggruppamento non funziona. Riceviamo 404 errori per entrambi gli script e gli stili generati.
Se installiamo .NET 4.5 sul server a 64 bit, funziona benissimo. Siamo confusi da questo perché alcuni server funzionano senza .NET 4.5, e questo lo richiede. Inoltre, Windows Server 2003/64-bit non è compatibile con .NET 4.5, quindi se questo ha un problema, questa correzione non funzionerà.
La cosa strana è che l'esempio di app per Internet campione di MVC 4 che ha come target .NET 4.0 x86 integrato funziona correttamente con 4.0 sul server dei problemi. Il web.config è esattamente lo stesso eccetto per la configurazione unity, logging, elmah e dot less.
Qualsiasi aiuto con questo sarebbe molto apprezzato.
Ecco il 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"));
}
}
}
Ecco come stiamo riferimento ai fasci nel nostro layout:
@Scripts.Render("~/bundles/WebApp.Main")
<link href="@Url.Content("~/Content/SiteLess.less")" rel="stylesheet" type="text/css" />
@Styles.Render("~/bundles/Content/WebApp.Main")
...
EDIT: Risposte/aggiornamenti
- Sì, la Il flag di applicazioni a 32 bit abilitato è impostato su True nel pool di app.
- Il percorso per la richiesta che dà il 404 assomiglia a questo http://xx.xx.xx.xxx/WebApp/bundles/WebApp.Main?v=03pBc7hdH1lHLtZGx-JMosNaLpMK7fcmI0uI6auknHw1
- Visualizzatore eventi di Windows non mostra nulla
- Funziona dopo l'installazione di .NET 4.5, disinstallarlo, quindi reinstallare .NET 4.0
- Funziona su un Enterprise 64-bit Server 2008. Il server problematico è una versione standard. Stiamo ricostruendo la VM per vedere se questo risolve il problema.
Questo potrebbe aiutare http://forums.asp.net/t/1846749.aspx/2/10?Published+MVC+web+to+IIS7+in+Windows+Server+2008+doesn+t+serve+ bundles – Jack
Pubblica il tuo BudleConfig.cs per favore – CrazyCoderz
@Jack Grazie, abbiamo letto il thread e abbiamo apportato le modifiche suggerite, ma non ha aiutato. Il nostro funziona davvero bene, appena installato con .NET 4.0 AND .NET 4.5 sulla scatola a 64 bit. Non pensavo che .NET 4.5 fosse un requisito. – Dustin