简体   繁体   中英

Error cannot find site object with identifier for site name using appcmd (ASP.Net)

I am trying to access asp.net application on local network via host name DNS so i need to register host header resulting in error:

error cannot find site object with identifier for InspectionDesign

While the command I am using for registering is:

C:\windows\system32\inetsrv\appcmd set site /site.name:InspectionDesign /+bindings.[protocol='http',bindingInformation='192.168.1.3:80:www.design.com']

While this command run successfully on system where site hosted.

This site is working fine on hosted machine and if I remove host header and run on local network via IP it works fine.

What is wrong? I need your suggestions. Thanks!

You mention that the appcmd to add a Host Header works fine on the system where the site is hosted. But this is the only place where the command should be executed (it is configuring IIS on that machine to interrogate and handle a Host header in the HTTP request), and you would expect to get an error like you are experiencing if you ran it on any other machine.

In order to navigate to www.design.com you need to configure your intranet's name resolution system to resolve www.design.com to the IP address of the machine running your site. You can verify this is the case by adding www.design.com to your local hosts file, and then navigate to www.design.com in your browser.

See the IIS docs for more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM