简体   繁体   中英

IIS 7.0 Site ID and ApplicationHost.config error

I recently used the App Cmd to add a website automatically to my IIS server. The script I used was similar to : site name="Site1 bindings="http/*:80site" id="1%%l"

This was created inside a batch script that generates XML for use in AppCmd Add Sites

The site was added correctly, however it assigned the same Site ID as an already existing Site.

The simple fix for this seems to be to delete the site and inside the ApplicationHost.config file remove the site from there (or change its site ID).

The problem however is that the file always is in use so I cannot save any changes. I have tried restarting the server and going right to that file however the same error occurs.

Is there a way to shut down IIS on startup so that this file is not in use? Or are there other solutions to this so that I can access my sites again.

Thanks

Found a solution to my problem.

Since the file (ApplicationHost.config) is always in use, I found a previous backup (/inetpub/history/) and copy/pasted. This is not a solution for everyone as it does remove any new config changes, however in my case I did not lose any data.

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