If you’re programmatically attempting to setup an IIS website and you’re calling AppCreate but ending up with a blank Application name (AppFriendlyName) it could be for one of two reasons.
- You called Invoke AppCreate after the CommitChanges
- If you’ve done 1 but doing that means the virtual directory doesn’t get turned into an application then it might be because you’ve tried to specify some of the details of the application by hand. I was trying to specify AppPoolId and AppRoot before calling AppCreate. When I removed that bit of code the app got created correctly and with a sensible name.
That ought to teach me not to cobble together things from lots of web articles!