Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've written a powershell script to create a web application, add libraries and pages, etc. As I work through the script and fix bugs and issues, I delete the web application through central administration and restart IIS.

When I run the script again, it always throws me the following error and after restarting IIS again, the script runs fine.

`http://SharePointApp:280` is already routed to the Default zone of another application. Remove that mapping or use a different URL

I tried to restart IIS a couple of times before running the script but that doesn't help either. Its just a little annoying to see this problem when I clearly restart IIS to remove any references of the deleted web application before running the script and have to do it again for some weird problem.

Has anyone seen this behaviour? How do I fix it?

share|improve this question
add comment

3 Answers

You can try by restarting timer job service. This type scenario happens when timer job stuck or malfunctions.

share|improve this answer
    
I did that, but it didn't work. Reopening the powersheel_ise.exe worked for me. –  Divi Mar 21 '13 at 3:20
add comment
  1. Rename the url http://SharePointApp:280 to http://SharePointAppX:280 in Central Admin > Alternate Access Mapping
  2. Then create the new webapp
  3. Then revert your url to http://SharePointApp:280
share|improve this answer
    
Thaks but I select the options to delete the content database and the IIS website when I delete the webapp from central administration –  Divi Mar 13 '13 at 21:56
    
Updated my answer. –  Max Melcher Mar 13 '13 at 22:11
    
Thanks Max, it seems like adding more steps to the process than reducing them –  Divi Mar 14 '13 at 1:42
add comment
up vote 0 down vote accepted

This seems to be an issue with the powersheel_ise.exe and once I close and reopen it, it seems to be fine. Here's a link I found.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.