开发者

CSS, Javascript and Images have zero length

I'm trying to port an ASP.NET MVC 1.0 / Visual Studio 2008 project to ASP.NET MVC RC 2 / Visual Studio 2010. The project is (and has always been) running on IIS 7.

Dynamic content (everything that's being delivered by controllers) works fine, but static content such as CSS / J开发者_JS百科avascript / Images gives me a "200 OK" response, a Content-Length of 0 and no content. It's as if all those files were entirely empty (I made sure the files are not empty though).

The static content is in a directory that I excluded from ASP.NET routing via IgnoreRoute.

It can't be a hidden 404 error since adding some garbage characters to the URL produces a reguar 404 error.

It doesn't seem to be related to filesystem permissions since I've already given everyone full access rights in the contents directory.

What could possibly be the problem?

Edit: I just created a completely new ASP.NET MVC website from scratch and tried running that in IIS. It has exactly the same problem! So it's not really a problem of converting my project to MVC2 at all, it rather seems to be IIS that's causing the trouble. But what could possibly be the problem?


As I just found out, the problem was that Control Panel -> Windows Features -> World Wide Web Services - > Common HTTP Features -> Static Content was not checked. Once I checked this, everything worked fine again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜