4
Vote

Scripts.Render renders nothing when app runs in virtual directory

description

When I run my app from http://localhost, Scripts.Render creates the expected output. If I create a new application pointing at the same directory in a virtual directory at http://localhost/dir, Scripts.Render renders nothing. No output is produced. Seems like a serious bug or undocumented feature to me.

comments

flipdoubt wrote Dec 7, 2012 at 3:20 PM

I have created new sites and found I cannot reproduce the problem on new sites, only the site I upgraded to using System.Web.Optimizations. The site behaves as if some part of the bundling is cached at the server, but I am not sure how or why. Could this be the case?

robertbird wrote Jan 23, 2013 at 10:28 PM

I have exactly the same issue. I have opened a stack overflow question here.

I upgraded an MVC3 app to MVC4, so flipdoubt, your comments are very interesting. What did you mean by upgraded to using System.We.Optimizations. Did you mean changing the version to the latest 1.0 release or upgrading the asp.net site like me?

The project in question is very large, so it would be great to work this out without having to recreate it. Although if I knew that would definitely fix the problem then at least I can move on from this issue.

robbird wrote Feb 6, 2013 at 12:26 PM

In my case, I've solved the issue I was having and the problem was of my own making. It turned out to be my use of T4MVC. See the stackoverflow post for the full details.