【问题标题】:Uploaded Mvc project on Windows Server show directories在 Windows Server 显示目录上上传的 Mvc 项目
【发布时间】:2015-04-04 04:41:37
【问题描述】:

我在 Windows Server 上上传了多个项目,有些是网站,有些是 MVC 项目,网站在 Windows 服务器上运行良好,使用 Default.aspx 但 MVC 项目具有控制器/动作/index.cshtml 意义,因此无法运行,显示 URL 中的所有目录

Below Url Show Directories these are MVC /Api Projects

   http://api.daakpad.com/
   http://fmsdemo.daakpad.com/
   http://api.punjabpragati.in/

Website code working fine 

   http://pms.gravitasoft.com/    // this have  default.aspx file on root working fine

【问题讨论】:

    标签: asp.net-mvc web windows-server


    【解决方案1】:

    我建议使用 .NET 检查您的 IIS 安装及其配置。

    1) 进入服务器管理界面并点击“添加角色”。或者转到控制面板 -> 程序和功能 -> 打开或关闭 Windows 功能。确保 IIS 已按照您需要的要求正确安装。

    2) 检查您需要的 .NET 框架是否已正确安装并在 IIS 中注册。检查this answer。要注册,请按照以下步骤 -

    • 打开命令提示符
    • 导航到 .NET 框架文件夹 = 查看 this page 的“查找正确版本的 Aspnet_regiis.exe”部分,找到您可能需要的正确版本的 aspnet_regiis。
    • 运行此命令“aspnet_regiis -ir”

    安装和注册 ASP.NET 4。此选项与 -i 选项相同,只是此选项不会更改与任何现有应用程序池关联的 CLR 版本。

    来源:MSDN - ASP.NET IIS Registration Tool

    3) 确保您的 MVC 应用程序的 AppPool 以集成模式与更高版本的 .NET(我认为应该是 4)运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-07
      • 1970-01-01
      相关资源
      最近更新 更多