HTTP错误403.14-禁止. ASP.NET MVC [英] HTTP Error 403.14 - Forbidden. Asp.NET MVC

查看:122
本文介绍了HTTP错误403.14-禁止. ASP.NET MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在尝试在IIS 10(Windows 10计算机)上本地托管ASP.NET MVC项目.但是,当我尝试访问该站点时,出现"HTTP错误403.14-禁止访问"错误. Web.Config文件的内容以及加载页面上的错误如下.还有其他东西吗?请提出建议.

Am trying to locally host an ASP.NET MVC project on IIS 10 (windows 10 machine). But when I try to access the site I get a "HTTP Error 403.14 - Forbidden" error. The contents of the Web.Config file as well as the error on the loading page are below. Is there something else am missing? Please suggest.

更新: 最后,我找出了问题所在.这是一个webapi项目,因此在Global.asax.cs中我忘记为正在使用的MVC控制器注册路由.

Update: Finally I figured out the issue. This is a webapi project so in the Global.asax.cs I forgot to register the route for the MVC controller which am using.

感谢您的所有建议.

Thank you for all the suggestions.

推荐答案

只需创建项目的虚拟目录并在IIS上运行它即可.

Just create virtual directory of project and run it on IIS.

  1. 打开Visual Studio (Run as administrator).
  2. 在IIS Express网站下选择您的网站.
  3. 右键单击Project / Site,然后单击Properties.
  4. 点击Website菜单,然后点击New Virtual Directory.
  5. 提供别名和文件夹路径.
  6. 保存设置,然后单击确定".
  1. Open Visual Studio (Run as administrator).
  2. Select your site under IIS Express Sites.
  3. Right click on Project / Site and click on Properties.
  4. Click on Website menu and New Virtual Directory.
  5. Give Alias Name and Folder path.
  6. Save The Setting and click ok.

现在与给定的别名和路径一样运行

Now run same as given alias name and path

就像http://localhost/ProjectName/Home/Index

这篇关于HTTP错误403.14-禁止. ASP.NET MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆