2

I'm working on a provider-hosted low-trust Share Point App. I used to develop it with the Debugging Function of Visual Studio which created a new Client ID and Client Secret every time the debugging session was started.

2>  Web.config updated with Client ID 4437f542-4f58-47a3-81ee-9116a03c6a5c 
2>  Installation is in progress (00:00:00)
2>  ...

As I would like to provide this App via the Office Store I will need a constant Client-ID. So I created one via the Seller Dashboard of Microsoft and updated my Web.config file.

ClientID in the Seller Dashboard

But now I'm getting this error message every time I start debugging the App with the new Client ID and Secret: The app "i:0i.t|ms.sp.ext|ClientID@b5990129-f04a-4d71-8a1f-5c958300a5e3" does not exist.

SharePoint Error Message

The only thing I can see in that app String is the ClientID.

I tracked the calls in my App and found out that the first thing which is called in my App is the OnActionExecuting(ActionExecutingContext filterContext) function in the SharePointContextFilterAttribute.cs file.

public override void OnActionExecuting(ActionExecutingContext filterContext)
{
    if (filterContext == null)
    {
        throw new ArgumentNullException("filterContext");
    }

    Uri redirectUrl;
    switch (SharePointContextProvider.CheckRedirectionStatus(filterContext.HttpContext, out redirectUrl))
    {
        case RedirectionStatus.Ok:
            return;
        case RedirectionStatus.ShouldRedirect:
            filterContext.Result = new RedirectResult(redirectUrl.AbsoluteUri);
            break;
        case RedirectionStatus.CanNotRedirect:
            filterContext.Result = new ViewResult { ViewName = "Error" };;
            break;
    }
}

The first time CheckRedirectionStatus() returns RedirectionStatus.ShouldRedirect and after that the App is not called again. So I guess the SharePoint throws an error after that redirection.

How do I get a ClientID created in the Seller Dashboard working with my provider-hosted App?

1 Answer 1

3

To solve this issue I had to edit the AppManifest.xml file under <AppPrincipal>

<AppPrincipal>
   <Internal />
   <!--<RemoteWebApplication ClientId="*" />-->
</AppPrincipal>

had the result that Visual Studio did not update the ClientID anymore when debugging. I changed it to

<AppPrincipal>
   <!--<Internal />-->
   <RemoteWebApplication ClientId="*" />
</AppPrincipal>

And it works fine in Deployment as well as in Debugging Mode :)

Sorry for taking your time.

1
  • 1
    Nothing to be sorry about. Helped me, too :)
    – Ole Albers
    Commented Feb 22, 2016 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.