如何在 Visual Studio 2017 Web Proj ASP.NET Core 2.0 中禁用 Https [英] How To Disable Https in Visual Studio 2017 Web Proj ASP.NET Core 2.0

查看:28
本文介绍了如何在 Visual Studio 2017 Web Proj ASP.NET Core 2.0 中禁用 Https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2017 中使用 ASP.NET Core 2.0 创建了一个默认项目.我选择了带有 MVC 和个人使用身份验证的 Web 应用程序.默认情况下,它正在配置并使用 https.我尝试通过进入项目属性并删除用户 ssl 并将 https 更改为 http 来禁用它,但随后我得到了 IIS Express 连接错误或 404.

I've created a default project in Visual Studio 2017 with ASP.NET Core 2.0. I've chosen the Web App with MVC and with Individual Use Auth. By default, it is coming up configured and working with https. I've tried disabling that by going into project properties and removing the user ssl and changing https to http but then I get either and IIS Express Connection error or a 404.

我以前没有看到默认的 https.这是从哪里来的,我可以在哪里禁用它?

I've not see default https before. Where is that coming from and where can I disable it?

推荐答案

我刚刚使用 net core 2.0 创建了一个默认的 MVC 应用程序.

I've just created a default MVC app using net core 2.0.

要禁用 SSL,您需要执行 2 个步骤.您可以通过使用 Visual Studio GUI 或通过编辑 launchsettings.json(进一步向下)来完成此操作

To disable SSL, you need to do 2 steps. You can do this either by using the Visual Studio GUI, or by editing the launchsettings.json (further down)

  • 转到您的项目属性
  • 在调试"类别中取消选中 SSL 选项
  • 将应用网址复制到开始浏览器输入

瞧:

如果你不喜欢使用这个界面,你也可以编辑launchsettings.json文件,通过设置sslPort: 0"launchUrl":"http://localhost:13121/"(或者你想要启动应用程序的任何地方)

If you are not a fan of using the interface, you can alternatively edit the launchsettings.json file, by setting sslPort: 0 and "launchUrl": "http://localhost:13121/" (or where ever you want to launch the application)

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:13121/",
      "sslPort": 0 
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "http://localhost:13121/",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "WebApplication1": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:13122/"
    }
  }
}

这篇关于如何在 Visual Studio 2017 Web Proj ASP.NET Core 2.0 中禁用 Https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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