简体   繁体   English

如何强制Visual Studio在https中运行网站

[英]How to Force Visual Studio to Run Website in https

A lot of my website requires https but when I launch my ASP.NET MVC website from Visual Studio, it loads in http . 我的很多网站都需要https但是当我从Visual Studio启动我的ASP.NET MVC网站时,它会加载到http

When I navigate to a page that requires https , on a controller that has the [RequireHttps] attribute it doesn't know that the https version of the site is running on port 44300, so it just attempts to redirect to https://localhost/login (default port). 当我导航到需要https的页面时,在具有[RequireHttps]属性的控制器上,它不知道该站点的https版本在端口44300上运行,因此它只是尝试重定向到https:// localhost / login (默认端口)。

Am I missing some kind of configuration? 我错过了某种配置吗? I have SSL Enabled = true in the properties for the MVC project. 我在MVC项目的属性中有SSL Enabled = true

I want to just be able to navigate my site as I would normally as if it were hosted on my server 我希望能像我通常那样在我的服务器上托管我的网站

Is this possible? 这可能吗?

Right click on your project and select Properties . 右键单击您的项目,然后选择“ Properties Select Web tab. 选择Web选项卡。 In Servers section you can change your project url to use https instead. 在“ Servers部分中,您可以更改项目URL以使用https

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

相关问题 如何在 HTTPS 上的 Visual Studio 中本地运行 Azure 函数? - How to run Azure Function locally within Visual Studio on HTTPS? VSTO:如何强制 Visual Studio 运行 Excel 的新实例 - VSTO: how to force Visual Studio to run a new instance of Excel 如何使用NUnit在Visual Studio中强制最后一次运行测试 - How to force a test run last in visual studio using NUnit 如何强制我的项目在Visual Studio 2013中始终以管理员身份运行? - How to force my project in Visual Studio 2013 to always run as Administrator? Visual Studio 网站在调试时将 http 重定向到 https - Visual Studio website is redirecting http to https when debugging Visual Studio安装项目:如何强制卸载程序以管理员模式运行? - Visual Studio Setup Project: How Can I force an Uninstaller to run in Administrator mode? 如何在Visual Studio中调试时强制执行异常? - How to force an exception while debugging in Visual Studio? 如何强制Visual Studio *真正*停止执行? - How to force Visual Studio to *really* stop execution? 如何在Visual Studio“网站”项目中更新引用? - How to update references in Visual Studio 'Website' project? 如何在 Visual Studio 中向网站添加新页面 - How to add a new page to a website in visual studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM