【问题标题】:Deploying MVC2 app iis6 on Window Server 2003 R2 x64在 Window Server 2003 R2 x64 上部署 MVC2 应用程序 iis6
【发布时间】:2010-12-03 18:27:51
【问题描述】:

我在 Window Server 2003 R2 x64 上部署 MVC2 应用程序时遇到问题。有没有人有同样的问题?我尝试了 global.asx、通配符映射的不同方法,但无济于事。我认为这是 Windows Server 2003 R2 x64 特定问题。

http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

Deploying Asp.Net MVC 2 /C# 4.0 application on IIS 6

【问题讨论】:

  • 您的应用有什么问题?没有编译?没有正确路由?其他的?
  • 编译没问题,在服务器上部署了一个发布箱并得到了 HTTP 401.1 - Unauthorized: Logon Failed 错误
  • 试试这个 Windows 2008 Server 和 IIS7 的分步教程。可能会帮助你。 arturito.net/2011/01/21/…

标签: asp.net-mvc-2 iis-6


【解决方案1】:

您的主目录中有 Default.aspx 吗?如果没有,请尝试使用此代码隐藏添加一个

public partial class _Default : Page
{
    public void Page_Load(object sender, System.EventArgs e)
    {
        // Change the current path so that the Routing handler can correctly interpret
        // the request, then restore the original path so that the OutputCache module
        // can correctly process the response (if caching is enabled).

        string originalPath = Request.Path;
        HttpContext.Current.RewritePath(Request.ApplicationPath, false);
        IHttpHandler httpHandler = new MvcHttpHandler();
        httpHandler.ProcessRequest(HttpContext.Current);
        HttpContext.Current.RewritePath(originalPath, false);
    }
}

【讨论】:

  • 我尝试从 Global.asax 中的 application.Start() 调试它,但它似乎根本没有成功。我正在考虑与配置相关的权限...
  • 也许它没有进入 ASP.NET 管道。网站是否在 IIS 中配置了 ASP.NET?另外,尝试直接点击 default.aspx,或 Controller/Action 路由。
  • 检查是否需要注册不同版本的asp.net。没想到那个CGK
  • hmm 现在它给出了加载配置文件时出错:拒绝访问路径“c://mypath/web.config”。
  • 看起来是权限问题...可能 IIS 没有读取该文件夹的权限(即位于默认 Web 路径之外)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-20
  • 1970-01-01
  • 1970-01-01
  • 2011-02-05
  • 2011-03-25
  • 1970-01-01
相关资源
最近更新 更多