【问题标题】:Localhost deployment - asp.net mvc 5本地主机部署 - asp.net mvc 5
【发布时间】:2015-05-17 00:25:45
【问题描述】:

我正在尝试将我的应用程序部署到本地主机,但无法完成。到目前为止,我做了以下事情:

属性 -> Web -> 使用本地 IIS / 创建虚拟目录

当我运行我的应用程序时,它会说

The requested page cannot be accessed because the related configuration data for the page is invalid.

配置来源:

Config Source:
34:   <system.webServer>
35:     <modules>
36:       <remove name="FormsAuthenticationModule"/>

配置错误:

Config Error       This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

如果我删除模块并开始调试,我会得到以下信息:

The Web server could not find the requested resource.

如果我手动转到 localhost/AppName 我会得到这个:

The Web server is configured to not list the contents of this directory.

和 localhost/AppName/Home

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

和路径 D:\Projects\AppName\AppName\home (与物理路径不对应,应该是 D:\Projects\AppName\AppName\Controllers\Home )

我该怎么办?

编辑:我还向我的用户授予了完全权限。怎么了?

【问题讨论】:

    标签: c# asp.net asp.net-mvc web-config localhost


    【解决方案1】:

    您可以检查应用程序池中的框架版本是否设置为4.0.30319(4.5) 还要确保文件夹结构正确

    添加全局错误处理程序并记录收到的异常以查看发生了什么。

    此链接包含有关错误处理的示例。 https://www.simple-talk.com/dotnet/asp.net/handling-errors-effectively-in-asp.net-mvc/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-31
      • 2017-03-27
      • 1970-01-01
      相关资源
      最近更新 更多