English 中文(简体)
第6号行政命令
原标题:Configuring IIS 6.0 to run an MVC3 application

第6号行政命令

我认为,我有一个配置问题,列在我的IIS 6服务器上,我想看一下我是否错过任何东西。

我提出的问题是,如果执行“Index”、“Home”的“Redirect ToAction”(例如,采用一种恢复行动的方法)的话,anytime。 我期待我返回:

http://servername.domain.com/virtualdirectoryname

然而,我转而转向:

http://servername.domain.com/virtualdirectoryname/virtualdirectoryname

这是卢比卢拉底附后虚拟名称的二例,可以说明为什么——本卢拉当然会产生404个没有发现错误的资源。 我在公司内联网和公共互联网环境中撰写并部署了数份MVC3应用程序,并能够显示我已经做过错。 我的全球美加澳新似乎ok——

public class MvcApplication : System.Web.HttpApplication
{
    public static void RegisterGlobalFilters(GlobalFilterCollection filters)
    {
        filters.Add(new HandleErrorAttribute());
    }

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
        );
     }

    protected void Application_AuthenticateRequest(Object sender, EventArgs e)
    {
        if (HttpContext.Current.User != null)
        {
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                if (HttpContext.Current.User.Identity is FormsIdentity)
                {
                    FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity;
                    FormsAuthenticationTicket ticket = id.Ticket;

                    // Get the stored user-data, in this case, our roles
                    string userData = ticket.UserData;
                    string[] roles = userData.Split( , );
                    HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(id, roles);
                }
            }
        }
    }

    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();

        RegisterGlobalFilters(GlobalFilters.Filters);
        RegisterRoutes(RouteTable.Routes);
    }
}

申请——要求复审处理把角色储存在使用者身上的问题,但除此之外,这似乎只是一纸空文。 我认为,我的唯一想法是,我ve开了虚拟名录。

在采取任何这些步骤之前,我已核实MVC3和4。 该网络框架安装在服务器上。 还有其他伙伴关系。 NET 4.0份没有发生事故的服务器应用程序。 还有一个MVC2号申请(MVC2号也安装),运行在这一服务器上,没有发生事故。

  1. I created a virtual directory off of the main "default site" using the IIS manager.
  2. Setup appropriate permissions on the folder that this virtual directory points to. Tested with a quick "Hello, World" index.html file.
  3. Copied the application from my development PC where the application works as developed to the folder described in #2.
  4. Updated the Web.Config file, editing the connection strings to point to the test database server; I had also verified these connection strings on my development PC.
  5. Open the web browser and hope for the best.

非常感谢任何援助。

感谢!

最佳回答

我认为你可以看到的是:

http://servername.domain.com/virtualdirectoryname/applicationname

如果你把你的虚拟名录命名为与你的申请相同的名称,那么我就能够看到这怎么会混淆你。 如果你没有虚拟名录,而只是你在Default网站的根基上提出申请,你就会看到:

http://servername.domain.com/applicationname

Is your virtual directory the same name as your application name? If so, that is why you see this.

问题回答

暂无回答




相关问题
IIS 6 Logs M.I.A

I m trying to find my IIS log files and I seem to be having a problem. First off I ve gone into IIS and right clicked on the site in question and selected properties... Under the Web Site tab I have ...

IIS6 SMTP Service and stop Delivery Reties?

Is there anyway to tell the SMTP service to stop trying to resend an e-mail that has been tried / failes x amount of times ? I can t find anything in the delivery tab to speicify this. Just curious if ...

Purpose of aspnet_isapi.dll hosted in w3wp - IIS 6?

What is the purpose of the ASP.NET ISAPI extension aspnet_isapi.dll that is hosted in the worker process w3wp.exe in IIS 6.0 ? In IIS 5.0, I understood that this ISAPI extension was responsible for ...

Does a 64-bit CruiseControl.NET exist?

Does a 64-bit CruiseControl.NET exist or do I need to install the 32-bit version? Our CI server is Server2003 64-bit. Currently I have been testing on WinXP Pro and no problems. If I do need to run ...

Tricking IIS 6.0 html web site into thinking it s at the root

I have no idea how to search for this one and perhaps Serverfault would be better but I ll start here. I have a HTML web site running at the root of one of my webservers. It runs fine and dandy. I ...

Socket transport "ssl" in PHP not enabled

I m having trouble enabling the socket transport "ssl" in PHP. When I run my script, I get the error: Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://www.my.site.com:443 ...

热门标签