Ok, so I'm losing my mind here. I cannot find a single helpful post about this and I just can't believe this is only happening to me, so I must turn my head to you, the all-around experts.
The problem is just like that: I created an MVC4 web using Visual Studio 2012 Ultimate. It works just dandy in my development machine and IIS Express 7. I can get CSS and Javascript bundles just fine even when minified. I have verified this by copying
the URL of the CSS bundle and I can download the CSS as a file just fine.
But if this web is published to the application server that runs IIS7 in Windows Server 2008 Service Pack2, 64-bit it just doesn't serve the bundles.
A simple MvcApplication1 consisting of the default project only presents the issue.
My web also doesn't show bundles, but interestingly enough the bundle URL was being routed to a controller. But this point is not important at all if we consider the fact that an out-of-the-box MVC4 project doesn't work either, so we are safe to assume
that whatever routes I have defined are irrelevant to this issue, right?
Anyway, there you have it.
P. S.: If you asked me, I would say there's a module or handler missing here, but I just don't know which or if this is even the case.
Thanks for stopping by. I Installed .Net 4.0 and .Net 4.5 in the server. That's it. Are you saying I need to install additional binaries?
Currently the Publish option in Visual Studio 2012 adds System.Net.Http.Formatting.dll, System.Web.Helpers.dll, System.Web.Http.dll, System.Web.Http.WebHost.dll, System.Web.Mvc.dll, System.Web.Optimization.dll, System.Web.Razor.dll, System.Web.WebPages.Deployment.dll,
System.Web.WebPages.dll, and System.Web.WebPages.Razor.dll to the \bin folder of the application. Are you referring to these?
Just for completeness, this is what I have in web.config for handlers:
Hello ignatandrei. I installed .Net 4.0 and 4.5. Just as I stated in the original response. I also get all those DLL's I mentioned in the same response in my \bin folder when I publish.
Please let me know if any of that is unclear. I'll do my best to clarify.
And in the spirit of clarification: I don't think I installed anything else regarding .Net or MVC. I don't recall ever reading anything about installing a special package for MVC in the server. All I have ever read points to installing stuff in the developer
machine only, never the web server.
Hello ignatandrei. I installed .Net 4.0 and 4.5. Just as I stated in the original response. I also get all those DLL's I mentioned in the same response in my \bin folder when I publish.
Please let me know if any of that is unclear. I'll do my best to clarify.
Yes, it is unclear . Please answer with yes or no
1. Did you install MVC 4 on server ?
2. If 1 is no, did you deploy the MVC 4 dll in the bin folder on server ?
3. If 2 is yes, could you assert it is there with Windows Explorer?
I did not install MVC4 on the server. I don't even know what that means as I have never read about such a thing before.
I have no idea what the MVC 4 dll is or is named and therefore I cannot assert whether is there or not. In my previous response I listed all System.*.dll files I got in the bin folder. Additionally I can say I have Microsoft.Web.Infrastructure.dll.
Aside from those DLL's I have others coming from NuGet packages, I think: Antlr3.Runtime.dll, Newtonsoft.Json.dll and WebGrease.dll.
You should have System.Web.Optimization.dll inside your bin folder and you must have BundleModule registered. Just
list all the http modules using to check whether it is registered. It seems there is some conflict. See this link for
detail.
"And whoever is removed away from the Fire and admitted to Paradise, he indeed is successful." (The Holy Quran)
Excellent Windows VPS Hosting Imran Baloch MVP, MVB, MCP, MCTS, MCPD
Hello imran_ku07, thanks for replying. I think you are in the right track, but still not there yet. It turns out that I do have
System.Web.Optimization.dll in the \bin folder of my web application in the server, and the list of active modules as per your link shows the following 16 active modules:
The last one seems to be the alleged needed module, but it is there and doesn't work as I don't get any style or script bundles. What could the cause be?
webJose
Member
730 Points
186 Posts
Published MVC web to IIS7 in Windows Server 2008 doesn't serve bundles
Sep 27, 2012 02:32 AM|LINK
Ok, so I'm losing my mind here. I cannot find a single helpful post about this and I just can't believe this is only happening to me, so I must turn my head to you, the all-around experts.
The problem is just like that: I created an MVC4 web using Visual Studio 2012 Ultimate. It works just dandy in my development machine and IIS Express 7. I can get CSS and Javascript bundles just fine even when minified. I have verified this by copying the URL of the CSS bundle and I can download the CSS as a file just fine.
But if this web is published to the application server that runs IIS7 in Windows Server 2008 Service Pack2, 64-bit it just doesn't serve the bundles.
A simple MvcApplication1 consisting of the default project only presents the issue.
My web also doesn't show bundles, but interestingly enough the bundle URL was being routed to a controller. But this point is not important at all if we consider the fact that an out-of-the-box MVC4 project doesn't work either, so we are safe to assume that whatever routes I have defined are irrelevant to this issue, right?
Anyway, there you have it.
P. S.: If you asked me, I would say there's a module or handler missing here, but I just don't know which or if this is even the case.
ignatandrei
All-Star
137690 Points
22151 Posts
Moderator
MVP
Re: Published MVC web to IIS7 in Windows Server 2008 doesn't serve bundles
Sep 27, 2012 05:56 AM|LINK
Did you install MVC4 on server or put MVC4 dll in the bin folder of application folder on server?
webJose
Member
730 Points
186 Posts
Re: Published MVC web to IIS7 in Windows Server 2008 doesn't serve bundles
Sep 27, 2012 08:03 PM|LINK
Thanks for stopping by. I Installed .Net 4.0 and .Net 4.5 in the server. That's it. Are you saying I need to install additional binaries?
Currently the Publish option in Visual Studio 2012 adds System.Net.Http.Formatting.dll, System.Web.Helpers.dll, System.Web.Http.dll, System.Web.Http.WebHost.dll, System.Web.Mvc.dll, System.Web.Optimization.dll, System.Web.Razor.dll, System.Web.WebPages.Deployment.dll, System.Web.WebPages.dll, and System.Web.WebPages.Razor.dll to the \bin folder of the application. Are you referring to these?
Just for completeness, this is what I have in web.config for handlers:
<handlers> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> </handlers>And this is an entry I had to add in order to get extensionless routing working:
<modules> <remove name="UrlRoutingModule-4.0" /> <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" /> </modules>ignatandrei
All-Star
137690 Points
22151 Posts
Moderator
MVP
Re: Published MVC web to IIS7 in Windows Server 2008 doesn't serve bundles
Sep 27, 2012 09:20 PM|LINK
And MVC4? Did you put at least into the bin folder?
webJose
Member
730 Points
186 Posts
Re: Published MVC web to IIS7 in Windows Server 2008 doesn't serve bundles
Sep 28, 2012 03:53 AM|LINK
Hello ignatandrei. I installed .Net 4.0 and 4.5. Just as I stated in the original response. I also get all those DLL's I mentioned in the same response in my \bin folder when I publish.
Please let me know if any of that is unclear. I'll do my best to clarify.
And in the spirit of clarification: I don't think I installed anything else regarding .Net or MVC. I don't recall ever reading anything about installing a special package for MVC in the server. All I have ever read points to installing stuff in the developer machine only, never the web server.
sp00k
Participant
1916 Points
435 Posts
Re: Published MVC web to IIS7 in Windows Server 2008 doesn't serve bundles
Sep 28, 2012 07:27 AM|LINK
you might have compiled a debug version where bundling is disabled.... try rebuilding your solution in release and try again :)
ignatandrei
All-Star
137690 Points
22151 Posts
Moderator
MVP
Re: Published MVC web to IIS7 in Windows Server 2008 doesn't serve bundles
Sep 28, 2012 07:55 AM|LINK
Yes, it is unclear . Please answer with yes or no
1. Did you install MVC 4 on server ?
2. If 1 is no, did you deploy the MVC 4 dll in the bin folder on server ?
3. If 2 is yes, could you assert it is there with Windows Explorer?
webJose
Member
730 Points
186 Posts
Re: Published MVC web to IIS7 in Windows Server 2008 doesn't serve bundles
Sep 28, 2012 07:18 PM|LINK
I did not install MVC4 on the server. I don't even know what that means as I have never read about such a thing before.
I have no idea what the MVC 4 dll is or is named and therefore I cannot assert whether is there or not. In my previous response I listed all System.*.dll files I got in the bin folder. Additionally I can say I have Microsoft.Web.Infrastructure.dll.
Aside from those DLL's I have others coming from NuGet packages, I think: Antlr3.Runtime.dll, Newtonsoft.Json.dll and WebGrease.dll.
Is this any better?
imran_ku07
All-Star
45864 Points
7713 Posts
MVP
Re: Published MVC web to IIS7 in Windows Server 2008 doesn't serve bundles
Sep 30, 2012 04:56 PM|LINK
You should have System.Web.Optimization.dll inside your bin folder and you must have BundleModule registered. Just list all the http modules using to check whether it is registered. It seems there is some conflict. See this link for detail.
Excellent Windows VPS Hosting
Imran Baloch MVP, MVB, MCP, MCTS, MCPD
webJose
Member
730 Points
186 Posts
Re: Published MVC web to IIS7 in Windows Server 2008 doesn't serve bundles
Oct 01, 2012 05:15 AM|LINK
Hello imran_ku07, thanks for replying. I think you are in the right track, but still not there yet. It turns out that I do have System.Web.Optimization.dll in the \bin folder of my web application in the server, and the list of active modules as per your link shows the following 16 active modules:
The last one seems to be the alleged needed module, but it is there and doesn't work as I don't get any style or script bundles. What could the cause be?