While developing a SharePoint Provider-hosted app, chances are you have come across this error " Error occurred in deployment step 'Install app for SharePoint': The remote server returned an unexpected response: (405) Method Not Allowed." At first you probably think, oh the deployment was just a little tempermental... I'll try it again. Come to find out, it happens over and over and over again. Luckily, the problem isn't all that complicated.
When I came across this problem I was a bit puzzled and couldn't really come up with a reason for why it had been happening. I had recently done a publish to Azure and everything was perfectly fine. However, I had started doing some changes in my development environment for which I wanted to test and this is when I started to get this error. When I modified the SharePoint App Manifest in my local environment to do some debugging, I took a look at the ClientID. By default the value is '*'.
What this means is that SharePoint is going to (for Visual Studio debugging purposes) create a new GUID for your ClientID and then update the corresponding web.config for your Web Application. So, if you are looking at your ClientID and you see a GUID instead of '*'... replace it with * for the time being while developing and you'll see that your error goes away!
Just remember when you are ready to deploy to a live site again, to change back the ClientID to the matching corresponding ClientID in the web.config of your web application!