我正在尝试将我的应用程序部署到本地主机,但无法完成。到目前为止,我做了以下工作:
属性 -> 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.
如果我手动转到本地主机/应用程序名称,我会得到这个:
The Web server is configured to not list the contents of this directory.
和本地主机/应用名称/主页
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 )
我该怎么办?
编辑:我还向我的用户授予了完全权限。怎么了?
可以检查应用程序池中的框架版本是否设置为 4.0.30319 (4.5)还要确保文件夹结构正确
添加全局错误处理程序并记录收到的异常以查看发生的情况。
此链接包含有关错误处理的示例。https://www.simple-talk.com/dotnet/asp.net/handling-errors-effectively-in-asp.net-mvc/