Pages

Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

Friday, September 9, 2016

"Your domain doesn't match the expected domain for this app deployment." issue in provider hosted add-in

Problem

One of my friend had an issue after deploying his provider hosted add-in in SharePoint on premise environment. He was not able to access list data from the add-in web of the Add-in. I looked at the code and the error was something as below.

provider

Solution

Step 01

Get the add-in id by navigating to

http://<SharePointWebsite>/_layouts/15/AppPrincipals.aspx

App identifier was something like the below and the text which was bolded will be the add-in id.

i:0i.t|ms.sp.ext|21ed123y-b1u9-4d54-9cb1-ee36b5f91304@9d2c9af1-aa54-42rf-ab8d-37d639b3f6ed

Step 02

Get the App Domain by going to below url and giving the add-in id which we got from the above.

http://<SharePointWebsite>/_layouts/15/AppInv.aspx

Step 03

My observation was that the App Domain which was given during registering the add-in was different from the url where the add-in has been hosted.

So, I registered the add-in again in the SharePoint site with the correct IIS host header and redeployed the add-in; which lead to work perfectly.

References

https://msdn.microsoft.com/en-us/library/office/jj687469.aspx

Thursday, October 31, 2013

The Web application at "" could not be found in WCF with SharePoint server object model

Problem Background

I was creating a WCF in Visual Studio 2012 using C# as the programming language and when I call SharePoint server object model in the WCF there was an exception saying The Web application at "" could not be found.


Solution Background

Its because IIS hosted WCF sites use ApplicationPoolIdentity as its user. This is not authorized to SharePoint farm. So we have to give farm administrators credential in order to access SharePoint server.

Solution

  • Open IIS 
  • Go to "Application Pools" 
  • Click on your WCF Service site 
  • Click on "Advanced Setting"




  • Click the corner "Identity" under Process Model in order to change the identity

  • Select "Custom account" and click "Set"



  • There give your farm administrator user name and password.