asp.net-mvchttpsasp.net-mvc-5bundleareas

MVC 5 bundles internal server error 500


I am trying to use bundles' feature for our project. Before we had no problems with bundles, because we used debug mode, so minification was switched off and scripts were generated correctly. Everything worked fine. In release mode I faced a problem when bundles files are empty because of a server error.

<link href="/Content/css?v=8NmJE7Tfgttds2oN3z8i40xNv93qpCusuz0h_AR3Y4s1" rel="stylesheet"/>


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

In browser I got internal server error. When I tied to get a resource manually I received the internal server error 500 as well. Bellow you can see error message details from the request trace log.

Detailed Error Information:
Module     global.asax
Notification       AcquireRequestState
Handler    System.Web.Optimization.BundleHandler
Error Code     0x00000000
Requested URL      https://localhost:44300/Content/css?v=8NmJE7Tfgttds2oN3z8i40xNv93qpCusuz0h_AR3Y4s1
Physical Path      C:\.........\Content\css
Logon Method       Anonymous
Logon User     Anonymous
Request Tracing Directory      C:\Users\.....

We use https protocol and areas in our project. I created simple MVC project and used bundles there, minimization worked fine, so I think this is not IIS problem. Any ideas why bundles might not work here?


Solution

  • I solved the problem. Our permissions system thinks that link to request resource localhost:44300/Content/css is simply a controller/action link.