在asp.Net MVC 2应用程序中没有的款式/图片 [英] No styles / images on asp.Net MVC 2 application

查看:111
本文介绍了在asp.Net MVC 2应用程序中没有的款式/图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候

我有我的ASP MVC应用程序有点问题。
在我的本地开发服务器一切工作得很好,但是当我尝试将应用程序发布到一个IIS 7.0服务器它只是显示没有任何款式/标记/图像纯网页。

i have a little problem with my ASP MVC application. On my local development server everything works just fine but when i try to publish the application to an IIS 7.0 server it just displays plain pages without any styles / markups / images.

我把所有这些东西在/内容/子文件夹,但是当我尝试访问在生产服务器上文件夹它只返回我没有找到404错误。

I put all those things in the /Content/ subfolder but when i try to access that folder on the production server it just returns me a 404 not found error.

我设置IIS服务器与.NET 4.0,随后在这里部署指南:<一href=\"http://www.asp.net/learn/mvc/tutorial-08-cs.aspx\">http://www.asp.net/learn/mvc/tutorial-08-cs.aspx

I set the IIS server up with .Net 4.0 and followed the deployment guide on here: http://www.asp.net/learn/mvc/tutorial-08-cs.aspx

所有视图/控制器/班似乎工作就好了,这不唯一的是内容的子文件夹,我不能明白为什么。

All views / controllers / classes seem to work just fine, the only thing which does not is the content subfolder and i cant see why.

任何人有一个建议,我可能忽略或没有人知道这个问题?

Anyone got a suggestion what i could have overlooked or does anyone know that problem?

推荐答案

我有同样的问题,但我发现它为什么被强迫在文件夹的内容认证的原因。

I had the same issue, but I found the reason why it was forcing authentication on the Contents folder.

当在再没有登录用户,它们被归类为匿名身份验证。在IIS7(这是我使用的是什么,猜测它是IIS6一样),你需要打开功能视图中的验证窗口。然后编辑匿名身份验证,使用你的应用程序池标识,或者默认的,只是确保用户拥有权限的文件夹中阅读。

When a user is not logged in yet, they are classified as Anonymous Authentication. In IIS7 (which is what I am using, guessing it is the same in IIS6) you need to open the authentication window in features view. Then edit the Anonymous Authentication, to use your application pool identity, or the default one, just make sure that user has permissions to read in that folder.

这是固定的,对我来说,希望它为你工作。

That fixed it for me, hope it works for you.

这篇关于在asp.Net MVC 2应用程序中没有的款式/图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆