[英]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.