c# - 错误 : your connection to this site is not private Asp. 网络。 MVC5

标签 c# asp.net-mvc windows-server-2016 iis-10

我正在为 asp.net mvc 5 应用程序设置一个带有 Windows Azure VM 的新服务器。我可以毫无问题地打开应用程序的每一页,但一个 Controller 除外。即每当我尝试打开属于特定 Controller 的页面时,它都会提示我输入用户名和密码,如下所示。

enter image description here

我在不同的 Windows Server 2016 VM 中使用相同的应用程序,没有任何问题。

我也没有看到应用程序/IIS 日志的任何错误。我的应用程序中没有任何 https 要求。

什么可能导致此行为?

namespace App.Controllers
{
    public class ReportsController : BaseController
    {
        private readonly IReportRepository reportRepository;
        public ReportsController(): this(new ReportRepository()){
        }

        public ReportsController(IReportRepository reportRepository){
        this.reportRepository = reportRepository;
        }

        public ViewResult Action()
        {
           return View(reportRepository.All);
        }
    }
 }

namespace App.Controllers
{
    [Authorize]
    public class BaseController : Controller
    {
    }
 }

更新:我将 ReportsController 重命名为 AppReportsController,问题就消失了。 即当我尝试访问时收到上述提示

http://domain/Reports/Action

但不适合

http://domain/AppReports/Action

能否请有人向我解释一下这是怎么回事?这是否意味着“Reports”被框架或其他东西保留?

最佳答案

我知道这是一篇旧帖子,但是我偶然发现了这篇文章,因为我遇到了与OP相同的错误。

我已经解决了这个问题,以防有人遇到同样的情况。 但解决方案可能会有所不同,具体取决于我们是否安装了相同的应用程序。

  1. 检查 Web 服务器/服务器是否安装了 sql server。
  2. 检查是否安装了报告服务。
  3. 从应用程序控制面板删除/卸载报告服务 如果您不知道如何删除报告服务,请点击此链接 How to remove Report Service

  4. 如果仍然遇到相同的错误,请再次检查。干杯!

关于c# - 错误 : your connection to this site is not private Asp. 网络。 MVC5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54362780/

相关文章:

asp.net - 缺少 IIS 10.0 上的 asp.net 功能

java - 在 Windows Server 2016/AWS 上运行的 Springboot Web 服务器无法正常工作

docker - 由于 Hyper-V 组件之一未运行,无法启动虚拟机 'MobyLinuxVM'

c# Appsettings 给出错误 : The name 'ConfigurationManager' does not exist in the current context

c# - 字段相等需要什么条件?

c# - 类库项目中的资源

asp.net-mvc - IISExpress 上的 ASP.NET MVC 为每个请求重建整个站点

asp.net-mvc - 如何在 Razor MVC 4 中使用 Ajax Control Toolkit?

c# - 添加新的选择列表项时对象引用错误

c# - 打印学生记录 : I want to show every record on a different page