When you get the 503 errors, have you considered looking at the event viewer on the machine to see if IIS logged the exception.
When started from Visual Studio, is it running in the Visual Studio web server or IIS? (This is a critical point. Visual Studio, since 2005, has used its own web server by default for web projects. And this web server is executed under your user account -- also critical for what's coming next.)
You're attempting to read some XML goodness out of a file. In .NET, in order to read a file, for some reason the user executing the code (in IIS7 I believe it is IIS_USERS and NETWORK SERVICE; in older versions of IIS, IUSR_MachineName and ASPNET) have to have both read and write access permissions. So the very first thing I'd check is the ACL on that XML file. Make sure the appropriate users have read/write access. This would be the NTFS permissions, by the way -- right-click the file in Explorer, choose Security, and add the appropriate perms.
What gave it away is that it works when you run the solution from Visual Studio, but not when it's executed from IIS. I don't believe you're getting 503 back from the web service -- you're most likely getting 503 from myApp
itself.
The reason for this 503 is because you're attempting to read this file on Application_Load
. That means that before any page can even attempt to be served, your XML file must be read and parsed. Upon reflection, and re-reading the question one more time, I'm now 99.99% certain that the inability to read this file (due to the lack of write permissions on it) is the issue.
My advice: Take out all of the admin stuff you'd done, take your user/ACL configuration back to normal, how it was -- including the AppPool. Then, follow the advice above to grant the appropriate IIS users read/write access to the XML file. I'm 99.99% sure your app will now work in IIS.