Skip to content
1 min read

Resolving SharePoint Error:The remote server returned an unexpected response: (405) Method Not Allowed.

Error:

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. ERROR_1
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 '*'.

Appmanifest

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!

Share
  
DON'T MISS!

Expert Insights from the Aerie Team

Drop us a line

Our team will be happy to answer your questions.

ADDRESS: 110 West Canal Street, Suite 201
Winooski, VT 05404

PHONE
: (813) 358-4656
HOURS: 8:00 am - 5:00 pm EST Monday to Friday
EMAIL: chanson@aerieconsulting.com