Die*_*hon 10 iis-express asp.net-core
我有一个多租户应用程序,可以在生产中访问customer.ourdomain.com.对于使用IIS的本地开发,我们使用自定义通配符域company-localdev.com.
使用IIS,无需任何特定配置即可运行.另一方面,IIS Express仅绑定到localhost.
我们正在进行ASP.NET 5的迁移项目,我们希望使用IIS Express来获得更轻松的开发人员体验.
是否可以让IIS Express收听*.company-localdev.com:1234?如果这可以自动化,那么开发人员可以通过在IIS中打开解决方案来使其工作.
Inr*_*ego 15
在ASP.NET 5/vNext中,可以找到配置文件
~ProjectFolder~/.vs/config/applicationhost.config
Run Code Online (Sandbox Code Playgroud)
从那里,你可以添加像rdans解释的新绑定.
Dar*_*tar 12
好吧,我让它在我的本地机器上运行,这里是我必须采取的所有步骤:
转到{YourProjectFolder}\.vs\config并编辑applicationhost.config文件:
<site name="MySite" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="{MyProjectFolderPath}" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:49861:localhost" />
<binding protocol="http" bindingInformation="*:80:example.com" />
<!-- for subdomain testing only -->
<binding protocol="http" bindingInformation="*:80:sub1.example.com" />
<binding protocol="http" bindingInformation="*:80:sub2.example.com" />
</bindings>
</site>
Run Code Online (Sandbox Code Playgroud)以管理员身份运行记事本,然后转到C:\Windows\System32\drivers\etc打开hosts文件并进行修改
127.0.0.1 example.com
127.0.0.1 sub1.example.com
127.0.0.1 sub2.example.com
通过在netsh HTTP提示符下运行CMD.EXE作为管理员和打字添加URL保留(得到netsh http>提示,您必须键入netsh然后按Enter,再http其次是Enter):
add urlacl url=http://example.com:80/ user=everyone
add urlacl url=http://sub1.example.com:80/ user=everyone
add urlacl url=http://sub2.example.com:80/ user=everyone
请记住,关键字everyone取决于Windows操作系统的语言.在法语操作系统上,user=everyone应该用user="Tout le monde"德语操作系统替换为user=jeder西班牙语user=todos等等......你明白了.
希望这可以帮助.
没有尝试过使用vs2015,但这与2012年的iis express一起使用.
转到您的文档文件夹.打开IISExpress/config.applicationhost.config.
搜索'sites'xml标记并找到您的网站.您可以像这样修改您的站点绑定:
<bindings>
<binding protocol="http" bindingInformation="*:1234:company-localdev.com" />
</bindings>
Run Code Online (Sandbox Code Playgroud)
如果我以管理员身份运行visual studio,则调试仅适用于我.
| 归档时间: |
|
| 查看次数: |
6573 次 |
| 最近记录: |