{"id":2693,"date":"2025-04-25T10:10:50","date_gmt":"2025-04-25T02:10:50","guid":{"rendered":"https:\/\/www.xfan.top\/?p=2693"},"modified":"2025-08-11T10:14:15","modified_gmt":"2025-08-11T02:14:15","slug":"visual-studio%e8%b0%83%e8%af%95c-asp-net%e9%a1%b9%e7%9b%ae%ef%bc%8c%e7%bd%91%e7%ab%99%e7%bb%91%e5%ae%9a%e5%9f%9f%e5%90%8d%e5%8f%8a%e5%85%81%e8%ae%b8%e5%a4%96%e9%83%a8%e8%ae%bf%e9%97%ae","status":"publish","type":"post","link":"https:\/\/www.xfan.top\/index.php\/2025\/04\/25\/2693\/","title":{"rendered":"Visual Studio\u8c03\u8bd5WEB\u9879\u76ee\uff0c\u7f51\u7ad9\u7ed1\u5b9a\u57df\u540d\u3001SSL\u8bc1\u4e66\u53ca\u5141\u8bb8\u5916\u90e8\u8bbf\u95ee"},"content":{"rendered":"<h2>\u7ed1\u5b9a\u57df\u540d<\/h2>\n<p>Visual Studio\u8c03\u8bd5C# ASP.NET\u9879\u76ee\u65f6\u4f7f\u7528IIS Express\u542f\u52a8\u670d\u52a1\u5668\uff0c\u9ed8\u8ba4\u60c5\u51b5\u53ea\u80fd\u7ed1\u5b9alocalhost\uff0c\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\u53ef\u4ee5\u7ed1\u5b9a\u4efb\u610fip\u6216\u57df\u540d\u3002\u53ef\u4ee5\u7ed1\u5b9a\u771f\u5b9e\u57df\u540d\u3001\u6dfb\u52a0\u8bc1\u4e66\uff0c\u5c06DNS\u89e3\u6790\u81f3\u5c40\u57df\u7f51\u5730\u5740\uff0c\u5c40\u57df\u7f51\u5185\u53ef\u8fdb\u884c\u771f\u5b9e\u57df\u540d\u4e0b\u7684\u63a5\u53e3\u8c03\u8bd5\u3002<\/p>\n<h3>\u4fee\u6539IIS Express\u7ed1\u5b9a\u7684\u57df\u540d\u548c\u7aef\u53e3<\/h3>\n<p>\u5728\u9879\u76ee\u8fd0\u884c\u540e\uff0c\u53f3\u952e\u72b6\u6001\u680f\u4e0a\u7684IIS Express\u56fe\u6807\uff0c\u70b9\u51fb<code>\u663e\u793a\u6240\u6709\u5e94\u7528\u7a0b\u5e8f<\/code>\uff0c<br \/>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xfan.top\/wp-content\/uploads\/2025\/04\/\u5c4f\u5e55\u622a\u56fe-2025-05-23-135155.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/www.xfan.top\/wp-content\/uploads\/2025\/04\/\u5c4f\u5e55\u622a\u56fe-2025-05-23-135155.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><br \/>\n\u53ef\u89c1\u5f53\u524dweb\u7a0b\u5e8f\u7ed1\u5b9a\u7684\u4e3b\u673a\u540d\u548c\u7aef\u53e3\uff0c\u6211\u8fd9\u91cc\u5df2\u7ecf\u6dfb\u52a0\u4e86\u7ed1\u5b9a\uff0c\u6240\u6709\u4f1a\u663e\u793a\u4e24\u4e2a\u3002<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xfan.top\/wp-content\/uploads\/2025\/04\/\u5c4f\u5e55\u622a\u56fe-2025-05-23-135238.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/www.xfan.top\/wp-content\/uploads\/2025\/04\/\u5c4f\u5e55\u622a\u56fe-2025-05-23-135238.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><br \/>\n\u70b9\u51fb\u4efb\u610f\u4e00\u4e2a\uff0c\u518d\u70b9\u51fb<code>\u914d\u7f6e<\/code>\u540e\u7684\u6587\u4ef6\u8def\u5f84\uff0c\u8fdb\u5165\u7f16\u8f91\u3002<br \/>\n\u627e\u5230site\u6807\u7b7e\u4e0b\u7684\u8bbe\u7f6e<\/p>\n<pre><code>&lt;site name=&quot;www(1)&quot; id=&quot;3&quot;&gt;\n    &lt;application path=&quot;\/&quot; applicationPool=&quot;Clr4IntegratedAppPool&quot;&gt;\n        &lt;virtualDirectory path=&quot;\/&quot; physicalPath=&quot;D:\\workplace\\\u5efa\u8bbe\u671f\u7248\\HRTL_003&quot; \/&gt;\n    &lt;\/application&gt;\n    &lt;bindings&gt;\n        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:49177:localhost&quot; \/&gt;\n        &lt;binding protocol=&quot;https&quot; bindingInformation=&quot;*:44333:f.hrtl.com.cn&quot; \/&gt;\n    &lt;\/bindings&gt;\n&lt;\/site&gt;<\/code><\/pre>\n<p>\u5728bindings\u4e2d\u6dfb\u52a0\u4e00\u4e2a<\/p>\n<pre><code>&lt;binding protocol=&quot;https&quot; bindingInformation=&quot;*:44399:f.hrtl.com.cn&quot; \/&gt;<\/code><\/pre>\n<p>\u503c\u5f97\u6ce8\u610f\u7684\u662fIIS Express\u4ec5\u652f\u6301\u7ed1\u5b9a44300-44399\u8303\u56f4\u5185\u7684\u7aef\u53e3\u4ee5\u5f00\u542fSSL\u3002<br \/>\n\u4fdd\u5b58\u6587\u4ef6\u540e\uff0c\u91cd\u542f\u9879\u76ee\u3002<\/p>\n<h2>\u6dfb\u52a0\u8bc1\u4e66<\/h2>\n<p>\u5148\u5c06\u8bc1\u4e66\u5b89\u88c5\u5230\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u8d70IIS\u4e2d\u5b89\u88c5\u8bc1\u4e66\u7684\u6d41\u7a0b\u3002<br \/>\n\u7136\u540e\u5c06\u8bc1\u4e66\u4e0e\u7aef\u53e3\u7ed1\u5b9a<\/p>\n<pre><code>netsh http add sslcert ipport=0.0.0.0:44333 appid=&#039;{&lt;APPID&gt;}&#039; certhash=&lt;\u8bc1\u4e66ID&gt;<\/code><\/pre>\n<ul>\n<li><code>&lt;APPID&gt;<\/code>\u4ec5\u7528\u4e8e\u552f\u4e00\u6807\u8bc6\u4e00\u6761\u7ed1\u5b9a\uff0c\u53ef\u4ee5\u81ea\u5df1\u751f\u6210\u4e00\u4e2aGUID\u6765\u4f7f\u7528\uff0c\u83b7\u53d6\u4e00\u4e2aGUID\uff1a<code>[guid]::NewGuid()<\/code>\u3002appid\u8981\u7528\u5355\u5f15\u53f7\u548c\u5927\u62ec\u53f7'{}'\u5305\u88f9\uff0c\u4f8b\u5982'{31e5ef34-93f1-419c-9ab5-24584d0fc0d6}'<\/li>\n<li><code>&lt;\u8bc1\u4e66ID&gt;<\/code>\u8bc1\u4e66\u6307\u7eb9\u67e5\u770b\u65b9\u5f0f\uff1a\u63a7\u5236\u9762\u677f -&gt; \u7ba1\u7406\u7528\u6237\u8bc1\u4e66<br \/>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xfan.top\/wp-content\/uploads\/2025\/04\/QQ\u622a\u56fe20250811100211.jpg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/www.xfan.top\/wp-content\/uploads\/2025\/04\/QQ\u622a\u56fe20250811100211.jpg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><\/li>\n<\/ul>\n<blockquote>\n<p>\u5982\u679c\u7ed1\u5b9a\u65f6\u63d0\u793a\uff1a<\/p>\n<pre><code>\u672a\u80fd\u6dfb\u52a0 SSL \u8bc1\u4e66\uff0c\u9519\u8bef: 183 \n\u5f53\u6587\u4ef6\u5df2\u5b58\u5728\u65f6\uff0c\u65e0\u6cd5\u521b\u5efa\u8be5\u6587\u4ef6\u3002<\/code><\/pre>\n<p>\u8868\u793a\u8fd9\u4e2a\u7aef\u53e3\u4e0a\u5df2\u6709ssl\u7ed1\u5b9a\u8bb0\u5f55\uff0c\u53ef\u80fd\u662fIIS Express\u81ea\u52a8\u6dfb\u52a0\u7684\u3002<br \/>\n\u67e5\u770b\u6240\u6709\u7aef\u53e3\u7684\u7ed1\u5b9a\u60c5\u51b5\uff1a<\/p>\n<pre><code>netsh http show sslcert<\/code><\/pre>\n<p>\u5220\u9664\u67d0\u4e2a\u7aef\u53e3\u7684\u7ed1\u5b9a\u8bb0\u5f55\uff1a<\/p>\n<pre><code>netsh http delete sslcert ipport=0.0.0.0:44333<\/code><\/pre>\n<\/blockquote>\n<h2>\u5141\u8bb8\u5916\u90e8\u8bbf\u95ee<\/h2>\n<p>\u7ec8\u7aef\u7ba1\u7406\u5458\u4f9d\u6b21\u6267\u884c<\/p>\n<pre><code>netsh http add urlacl url=\u7f51\u7ad9\u7ed1\u5b9a\u7684URL user=&quot;NT AUTHORITY\\INTERACTIVE&quot;\nnetsh advfirewall firewall add rule name=&quot;IISExpressWeb&quot; dir=in protocol=tcp localport=\u7f51\u7ad9\u7ed1\u5b9a\u7684\u7aef\u53e3 profile=private remoteip=localsubnet action=allow<\/code><\/pre>\n<blockquote>\n<p>\u5982\u679c\u63d0\u793a<\/p>\n<pre><code>\u6dfb\u52a0 URL \u4fdd\u7559\u9879\u5931\u8d25\uff0c\u9519\u8bef: 183\n\u5f53\u6587\u4ef6\u5df2\u5b58\u5728\u65f6\uff0c\u65e0\u6cd5\u521b\u5efa\u8be5\u6587\u4ef6\u3002<\/code><\/pre>\n<p>\u5219\u5148\u4f7f\u7528\u547d\u4ee4\u5220\u9664<\/p>\n<pre><code>netsh http delete urlacl url=\u7f51\u7ad9\u7ed1\u5b9a\u7684URL<\/code><\/pre>\n<p>\u518d\u4f7f\u7528\u7b2c\u4e00\u6761\u547d\u4ee4\u6dfb\u52a0<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u7ed1\u5b9a\u57df\u540d Visual Studio\u8c03\u8bd5C# ASP.NET\u9879\u76ee\u65f6\u4f7f\u7528IIS Express\u542f\u52a8\u670d\u52a1\u5668\uff0c\u9ed8\u8ba4\u60c5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-2693","post","type-post","status-publish","format-standard","hentry","category-webappdev"],"_links":{"self":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts\/2693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/comments?post=2693"}],"version-history":[{"count":14,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts\/2693\/revisions"}],"predecessor-version":[{"id":2842,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts\/2693\/revisions\/2842"}],"wp:attachment":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/media?parent=2693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/categories?post=2693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/tags?post=2693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}