简体   繁体   English

Localhost部署-ASP.NET MVC 5

[英]Localhost deployment - asp.net mvc 5

I am trying to deploy my app to localhost and can't get it done. 我正在尝试将我的应用程序部署到localhost,但无法完成。 Until now, I did the following: 到目前为止,我已执行以下操作:

Properties -> Web -> Use Local IIS / Create Virtual Directory 属性-> Web->使用本地IIS /创建虚拟目录

When I run my app it says 当我运行我的应用程序时,它说

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

Config Source: 配置源:

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

Config Error: 配置错误:

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".

If I remove modules and start Debugging I get the following: 如果删除模块并开始调试,则会得到以下信息:

The Web server could not find the requested resource.

If I manually go to localhost/AppName I get this: 如果我手动转到localhost / AppName,则会得到以下信息:

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

and localhost/AppName/Home 和localhost / AppName / Home

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

and the path D:\\Projects\\AppName\\AppName\\home (not corresponding with the physical one, it should have been D:\\Projects\\AppName\\AppName\\Controllers\\Home ) 和路径D:\\ Projects \\ AppName \\ AppName \\ home(与物理路径不对应,应该是D:\\ Projects \\ AppName \\ AppName \\ Controllers \\ Home)

What should I do? 我该怎么办?

Edit: I also gave full permissions to my user. 编辑:我也给我的用户完全权限。 What is wrong? 怎么了?

You can check if the framework version in application pool is set as 4.0.30319 (4.5) Also ensure that the folder structure is proper 您可以检查应用程序池中的框架版本是否设置为4.0.30319(4.5)并确保文件夹结构正确

Add a global error handler and log the received exception to see what's happening. 添加一个全局错误处理程序并记录接收到的异常以查看发生了什么。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM