Error occurred in deployment step 'Uninstall app for SharePoint': The remote server returned an error: (502) Bad Gateway.
Installed SP 2013 Foundation in my Hyper-V machine
Created and done all the steps mentioned here http://blogs.msdn.com/b/shariq/archive/2013/05/07/how-to-set-up-high-trust-apps-for-sharepoint-2013-amp-troubleshooting-tips.aspx && http://msdn.microsoft.com/en-us/library/office/fp179901%28v=office.15%29.aspx
for self signed certificate
copied those two certificates in my local machine(base machine) D drive
(D:\Cert)
Both VM and base machine are in same domain
Installed VS 2013 in my base machine and create a Provided hosted app with the copied certificates, (For creation i followed the above mentioned URL)
Just created and hit F5 to run in my base machine, but getting this error
Error occurred in deployment step 'Uninstall app for SharePoint': The remote server returned an error: (502) Bad Gateway.
Please help me to resolve this issue, trying to figure out from last 2 days
Thanks in Advance
Arun
Hi Harminder,
This happens because an app has already been deployed and you are deploying it again using the same version.
Resolution:
Open the AppManifest.xml file and change the version.
Vivek Jagga - MCTS SharePoint
SharePointExcellence
Similar Messages
-
While deploying the SharePoint Hosted App I am facing the issue 'Uninstall app for SharePoint': Only users who can View Pages can list Apps"
- Provided the permissions for App Management and Subscription Services as well as DB.
- Added into Host web as SC Administrator
Thanks in Advance.Hi,
The user you are running with Visual Studio should have read permission on the pages of SharePoint web you are trying to deploying your app.
I suggest you add the login user to the SharePoint web in the “Site Settings”->”People and Group”.
Here is a similar thread for your reference:
http://sharepoint.stackexchange.com/questions/68590/error-occurred-in-deployment-step-uninstall-app-for-sharepoint-only-users-who
More reference:
Step by step How to configure environment for app development:
http://gianespo.wordpress.com/2014/01/30/step-by-step-how-to-configure-environment-for-sharepoint-app-development/
Best regards
Zhengyu Guo
TechNet Community Support -
I am facing this problem while start debugging the Provider-Hosted app through VS2013. I want to deploy the app with same version. So please let me know any solution
to remove the app instance from office365 online, so that I can deploy the same app with same version on the specified "Developer Site".
Note: If I change the version in AppManifesst.xml file then this problem/error gets resolved. But I want to deploy with the same version as
per my business requirement.
The actual error renders while I click to "Start" button of the Visual Studio 2013 to deploy the provider-hosted app, for the sake
to deploying it on say "ABC" site collection (i.e. developer site). I work on office365 online. Therefore, request you to please provide the solution for SharePoint online office 365. The occurrences is:
"Error occurred in deployment step 'Install app for SharePoint': The provided App differs from another App with the
same version and product ID."
Please assist me anyone. It will be so kind of you.....
Naveen Kumar
Steria India Ltd.Did you updated the AppManifest.xml file
and change the version.
If this helped you resolve your issue, please mark it Answered -
While deploying sharepoint hosted app i am getting error "Error occurred in deployment step 'Install app for SharePoint': We're sorry, we weren't able to complete the operation, please try again in a few minutes. If you see this message repeatedly, contact
your administrator.". From the developer site i remove the app manually and after deploying i am getting the same error again.
Harminder singhI was trying to install SharePoint 2013 on premise development environment and encountered the following issues while deploying the app using Visual studio 2013.
Please refer these articles for configuration settings.
http://blogs.msdn.com/b/how24/archive/2013/06/14/prepare-your-sharepoint-2013-farm-for-app-development-and-debugging.aspx
http://www.codeproject.com/Articles/515677/MyplusFirstplusSharepoint-HostedplusAppplusinplus2
http://blogs.technet.com/b/mspfe/archive/2013/01/31/configuring-sharepoint-on-premise-deployments-for-apps.aspx
http://aanuwizard.com/2012/12/07/article-14-from-30-system-account-can-not-deploy-or-purchase-an-app-in-sharepoint-2013-rtm/
Error 1:
Error occurred in deployment step 'Install app for SharePoint': The System Account cannot perform this action.
Error 2:
The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm.
Error 3:
Error occurred in deployment step 'Install app for SharePoint': We're sorry, we weren't able to complete the operation, please try again in a few minutes. If you see this message repeatedly, contact your administrator.
Solution:
For error 1, follow these instructions:
a. Create a new domain account DOMAIN\myApp_Admin
b. add DOMAIN\myApp_Admin to local admin group
c. add DOMAIN\myApp_Admin to Farm Administrators group
Central Admin site --> Site Settings --> People and groups
Add DOMAIN\myApp_Admin
For error 2 & 3, follow these instructions:
1. Grant DOMAIN\myApp_Admin accont a sysadmin server role on SQL server
2. Open SharePoint Power Shell and execute Add-SPShellAdmin <DOMAIN\myApp_Admin> command.
3. Grant DOMAIN\myApp_Admin a db_owner rights to web application Content database that you would like to use for debugging SharePoint 2013 app.
4. Make sure following roles are assigned for SharePoint_Config database
SharePoint_Shell_Access
SPDDataAccess
public
5. Make sure following roles are assigned for SharePoint_Content database
db_owner
5. Make sure following roles are assigned for SharePoint_AdminContent database
public -
Error occurred in deployment step 'Install app for SharePoint, ULS log as below:
0x0BA8 SharePoint Foundation App Deployment acjjg Medium The current user has System.Threading.Thread.CurrentPrincipal.Identity.Name
= 0#.w|perf\abraham.lincoln, System.Security.Principal.WindowsIdentity.GetCurrent().Name = NT AUTHORITY\IUSR, System.Web.HttpContext.Current.User.Identity.Name = 0#.w|perf\abraham.lincoln. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.39 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ag8d6 Medium SPApp: CreateAppUsingPackageMetadata: isCabStream is false. Treating the stream as a ZIP. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.39 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ahkn9 High Deleting App with fingerprint TJQrYuD5N+kEe38LZtl6wSs3Ak3yYvWcmwuNLTqtpdFzb4qSMopN3SWCRdWvntrKoM7qIS2S2llpA5omi8iHqQ==
on site 264dc389-d394-4985-a43c-ad91a383c0df dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.39 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ahkob High The App with fingerprint TJQrYuD5N+kEe38LZtl6wSs3Ak3yYvWcmwuNLTqtpdFzb4qSMopN3SWCRdWvntrKoM7qIS2S2llpA5omi8iHqQ==
on site 264dc389-d394-4985-a43c-ad91a383c0df was to be deleted, but it did not exist dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment abnqa Medium App Packaging: CreatePackage: There are 10 parts in the package. There are 1 package-part relationships
in the package. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment afyz6 Medium SPAppResources: ParseResources: No default resource file was found. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment afyzx Medium SPAppResources: ParseResources: no resource file relationships were found. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aebgs Medium SPPackageUtility: ExtractPart: Creating directory 'C:\Users\abraham.lincoln.PERF\AppData\Local\Temp\71345ca6-3565-43d8-9017-2d3336965d8f\extract' dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aebgt Medium SPPackageUtility: ExtractPart: Creating file 'C:\Users\abraham.lincoln.PERF\AppData\Local\Temp\71345ca6-3565-43d8-9017-2d3336965d8f\extract\AppManifest.xml' dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddw Medium SPPackageUtility: ExtractPart: Part stream length is '1072'. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddz Medium SPPackageUtility: ExtractPart: Length is '1072', not locking before copying the stream. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aebgt Medium SPPackageUtility: ExtractPart: Creating file 'C:\Users\abraham.lincoln.PERF\AppData\Local\Temp\71345ca6-3565-43d8-9017-2d3336965d8f\extract\AppIcon.png' dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddw Medium SPPackageUtility: ExtractPart: Part stream length is '3540'. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddz Medium SPPackageUtility: ExtractPart: Length is '3540', not locking before copying the stream. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aidi7 Medium SPIconAppPartValidator: IsSupportedFormat: image raw format is 'b96b3caf-0728-11d3-9d7b-0000f81ef32e'. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment afyz6 Medium SPAppResources: ParseResources: No default resource file was found. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment afyzx Medium SPAppResources: ParseResources: no resource file relationships were found. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aebgt Medium SPPackageUtility: ExtractPart: Creating file 'C:\Users\abraham.lincoln.PERF\AppData\Local\Temp\71345ca6-3565-43d8-9017-2d3336965d8f\extract\featurecc1deab7-efdf-4cc2-80ae-60e073577d64.xml' dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddw Medium SPPackageUtility: ExtractPart: Part stream length is '321'. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddz Medium SPPackageUtility: ExtractPart: Length is '321', not locking before copying the stream. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aebgt Medium SPPackageUtility: ExtractPart: Creating file 'C:\Users\abraham.lincoln.PERF\AppData\Local\Temp\71345ca6-3565-43d8-9017-2d3336965d8f\extract\elements4d87f314-4b0a-4b89-8a7e-9cb73c99f25f.xml' dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddw Medium SPPackageUtility: ExtractPart: Part stream length is '849'. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddz Medium SPPackageUtility: ExtractPart: Length is '849', not locking before copying the stream. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aerhy Medium App Packaging - List of App Parts (count ='2'): Name='SPIconAppPart',Name='SPFeatureAppPart', dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aerhz Medium App Packaging - List of Deployment Groups (count ='3'): Name='SPIconDeploymentGroup',Name='SPTargetWebDeploymentGroup',Name='SPQuickLaunchDeploymentGroup', dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment mq71 Medium Creating App with fingerprint TJQrYuD5N+kEe38LZtl6wSs3Ak3yYvWcmwuNLTqtpdFzb4qSMopN3SWCRdWvntrKoM7qIS2S2llpA5omi8iHqQ==
to site 264dc389-d394-4985-a43c-ad91a383c0df. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.44 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment afpd2 Medium Committing package with fingerprint TJQrYuD5N+kEe38LZtl6wSs3Ak3yYvWcmwuNLTqtpdFzb4qSMopN3SWCRdWvntrKoM7qIS2S2llpA5omi8iHqQ==
and data length 8010 to site 264dc389-d394-4985-a43c-ad91a383c0df. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.46 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajk9e Medium Writing 8010 bytes to database for app with fingerprint TJQrYuD5N+kEe38LZtl6wSs3Ak3yYvWcmwuNLTqtpdFzb4qSMopN3SWCRdWvntrKoM7qIS2S2llpA5omi8iHqQ== dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.50 w3wp.exe (0x2170)Hi Jerry,
I agree with Nikhil, I think you have posted partial ULS log, we could not find effective errors for the issue.
For Provider Hosted app in SharePoint server on-premise,
the TokenHelper class will try to access your Azure Security Principle by default.
Did you have a valid Azure account?
If not, the issue may be caused that you don't have a valid account, to resolve this issue, you can use
a valid Azure account or not going to use Azure Platform for hosting the app as the article
below.
http://pratapreddypilaka.blogspot.jp/2012/12/sharepoint-2013-avoiding-azure-on-dev.html
Thanks,
Jason
Jason Guo
TechNet Community Support -
Error occurred in deployment step 'Install app for SharePoint
Hi i had created a LightSwitch HTML Application using Visual Studio 2013.
The build was successful, but when i try to deploy in sharepoint through F5, suppose to get this error message
Error occurred in deployment step 'Install app for SharePoint':
We're sorry, we weren't able to complete the operation, please try again in a few minutes. If you see this message repeatedly, contact your administrator.
How to approach/ resolve this issueHi Ashok
Pls check this
http://social.technet.microsoft.com/Forums/sharepoint/en-US/c8eb6c92-e1b2-45a9-840e-c782bdc933ec/error-occurred-in-deployment-step-install-app-for-sharepoint-were-sorry-we-werent-able-to?forum=sharepointdevelopment
Please remember to click 'Mark as Answer' on the answer if it helps you -
Hi everyone,
I `m getting error message like this "Error occurred in deployment step 'Install app for SharePoint': There were errors when validating the App manifest.". when i try to debug the application with "Start Action"="Internet Explorer".This
application is an apps for office application with Oauth with Office 365
Any help in this regard is greatly appreciated
Thanks!!
Santosh SutarThanks Fei for your time.
>>>I would suggest that you create a new project and set it start action with 'Internet Explorer'
to see whether this issue could be reproduced. If no, we can compare the difference between the two menifest files.
As per your suggestion above ,With new project,I can debug with with start action "Internet Explorer" and I
could not see much difference between the manifest files.
Please find below my manifest file for the reference .
<?xml version="1.0" encoding="UTF-8"?>
<!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TaskPaneApp">
<Id>084cd6cd-2908-44d1-a5cf-4fa029aec211</Id>
<Version>1.0.0.0</Version>
<ProviderName>[Provider name]</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Office 365 MVC" />
<Description DefaultValue="Office 365 MVC"/>
<AppDomains>
<AppDomain>https://login.microsoftonline.com</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Document" />
<Host Name="Workbook" />
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="~remoteAppUrl/Home/Index/" />
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
</OfficeApp>
Please suggest on this.
Thanks !!
Santosh Sutar -
Error occurred in deployment step 'Install app for SharePoint': Das Querladen von Apps ist auf dieser Website nicht aktiviert.
I am new to sharepoint app development. When i am trying to deploy my developed app in sharepoint i am getting the above error. Sorry, i dont know the exact error in English because our sharepoint is in German language.
Please help me to get rid from this.
Dhinesh BalaHi Dhinesh,
Technically we cannot deploy the app on any site. It has to be a site created from developer site template..Here are some useful information for you.
http://blogs.msdn.com/b/officeapps/archive/2013/12/10/enable-app-sideloading-in-your-non-developer-site-collection.aspx
https://curah.microsoft.com/248050/side-loading-of-apps-is-not-enabled-on-this-site-error-while-installing-app-in-sharepoint-2013
Regards,
Partha
Regards, Partha Avepoint Please mark the response as "Answer" if it answers your response If this response takes you closer to your solution mark it as a "helpful post" -
Hi All,
i have created the Cloud Business App in visual studio 2013 .
it ask share point server like below
Now i given my share point server url and click finish button it create the cloud business app .
Now i have added required screen in that HTML Client Appliction
The Solution will be successfully build .Now i press F5 or Start button it throws the below error in errorList
In Output window its show the below details
How to resolve this error ? what wrongly i done in this .Please any one help me to resolve this issue
Thanks
Gobala
gobalakrishnan SHi,
It says apps are desasbled on this site. Are you using developer site collection ?
Thanks
Melick Rajee http://melick-rajee.blogspot.com -
Hi,
I have a customer running a provider hosted app and in Sharepoint 2013. Things have been working fine but recently they keep experiencing an issue where the all the app parts on the page show the following error message. Does anyone have an idea what
could be causing this problem and how I can fix it? The Sharepoint site and provider hosted app site are running on a Server 2008 R2 box with IIS 7.5.
Server Error in '/Test.Sharepoint.App' Application.
The remote server returned an error: (429) Too Many Requests.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote server returned an error: (429) Too Many Requests.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The remote server returned an error: (429) Too Many Requests.]
System.Net.HttpWebRequest.GetResponse() +8527180
Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute() +58
Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb) +975
Test.Sharepoint.AppWeb.Pages.LatestAnnouncement.GetLatestAnnouncement(Boolean showFullText) +610
Test.Sharepoint.AppWeb.Pages.LatestAnnouncement.Page_Load(Object sender, EventArgs e) +764
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18034
Impreza Software DevelopmentHi GuYumming,
I have checked the Sharepoint site using Fiddler and my X-SharePointHealthScore stays consistently on 1, I have even refreshed the site and had the "(429) Too Many Requests" error happen right in front of me whilst Fiddler is running and when I look at the
200 response for the Sharepoint site it is still showing "X-SharePointHealthScore: 1".
I assume because of this I do not need to make any of the changes suggested in your article above?
I have also been through the ULS logs and found the following 3 log entries that appear to relate to the issue but they do not really mean much to me so I am hoping that you can help:
Begin CSOM Request ManagedThreadId=59, NativeThreadId=12476
SPResourceTally(ClientServiceRequestDuration) value 1 + 150425 > 150000
ResourceBudgetExceeded, sending throttled status code. Exception=Microsoft.SharePoint.SPResourceBudgetExceededException: ResourceBudgetExceeded at Microsoft.SharePoint.SPResourceTally.Check(Int32 value)
at Microsoft.SharePoint.SPAggregateResourceTally.Check(SPResourceKind kind, Int32 value) at Microsoft.SharePoint.Client.SPClientServiceHost.OnBeginRequest()
Impreza Software Development -
Hi,
We are trying to deploy the provider hosted app in server environment . we are getting the "The remote server returned an error :(401) unauthorized" error after deploy the app in server.
stack Trace:
[webException:Te remote server returned an error:(401) UnAuthorized.]
System.Net.HeepWebRequest.GetResponse().
Followed the same MSDN steps , but sill same error. We have attached the certificate and using the same issuer ID in the app web.config.
Verified the IIS setting and still getting the same error when we call the "Clientcontext.ExecuteQuery()" method.
Same code is working fine in my Local dev environment.
If anyone have idea about this issue, please let me know.
Thank you,
MylsamyHi ,Thank you for your response. We have tried all the options and everything is same (Client ID,Issuer ID...etc) and finally figured out the issue.The below link saved my day.http://msdn.microsoft.com/en-us/library/office/dn762439(v=office.15).aspxIn "TokenHelper.cs" GetRealmFromTargetUrl method always return null andWhen we analyze the issue we found some variable name assigned for "Realm" Instead of GUID in SP server.Power shell command to get the Realm in SP server: Get-SPAuthenticationRealmWe have followed below article to generate the new GUID for realm.http://technet.microsoft.com/en-us/library/jj219756(v=office.15).aspx$c =Get-SPServiceContext -Site "http://<websiteurl>"Set-SPAuthenticationRealm -ServiceContext $c -Realm "a686d436-9f16-42db-09b7-cb578e110ccd".
Thankyou,Mylsamy -
Hi,
Any help appreciated!!
I'm getting this error: "The remote server returned an error: (401) unauthorised when I debug a provider-hosted app. I get the error on this line:
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
See code below
I created a high trust development environment following the instructions provided here:
http://msdn.microsoft.com/en-us/library/office/fp179901(v=office.15).aspx and
http://msdn.microsoft.com/library/office/fp179923
I created a provider-hosted app with the intent to:
create a SharePoint list in the appweb
Use self-signed certificate, tokenhepler.cs and sharepointcontext.cs to retrieve current user context and access on SharePoint. (No changes were made to tokenhelper.cs and sharepointcontext.cs)
retrieve list items from the SharePoint list in a button click event handler on a default.aspx of the remote web
What happens:
The app is deployed successfully to the Dev site
The SharePoint feature is deployed and activated
The default.aspx page of the remote web loads
The error (see image) is returned on clicking of the button
My environment is an on-premise SharePoint 2013 with AD and my dev box is standalone windows 8.1 running Visual Studio Professional 2013 Update 3.
The code block below is a copy of the default.aspx code-behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.SharePoint.Client;
using Microsoft.IdentityModel.S2S.Tokens;
using System.Net;
using System.IO;
using System.Xml;
using System.Data;
using System.Xml.Linq;
using System.Xml.XPath;
namespace Idea.GeneratorWeb
public partial class Default : System.Web.UI.Page
SharePointContextToken contextToken;
string accessToken;
Uri sharepointUrl;
protected void Page_PreInit(object sender, EventArgs e)
Uri redirectUrl;
switch (SharePointContextProvider.CheckRedirectionStatus(Context, out redirectUrl))
case RedirectionStatus.Ok:
return;
case RedirectionStatus.ShouldRedirect:
Response.Redirect(redirectUrl.AbsoluteUri, endResponse: true);
break;
case RedirectionStatus.CanNotRedirect:
Response.Write("An error occurred while processing your request.");
Response.End();
break;
protected void Page_Load(object sender, EventArgs e)
//// The following code gets the client context and Title property by using TokenHelper.
//// To access other properties, the app may need to request permissions on the host web.
var spContext = SharePointContextProvider.Current.GetSharePointContext(Context);
//var spContext = new ClientContext("MySPDevInstance");
//spContext.Credentials = new NetworkCredential("username", "password");
//using (var clientContext = spContext.CreateUserClientContextForSPHost())
// clientContext.Load(clientContext.Web, web => web.Title);
// clientContext.ExecuteQuery();
// Response.Write(clientContext.Web.Title);
string contextTokenString = TokenHelper.GetContextTokenFromRequest(Request);
if (contextTokenString != null)
// Get context token
contextToken = TokenHelper.ReadAndValidateContextToken(contextTokenString, Request.Url.Authority);
// Get access token
sharepointUrl = new Uri(Request.QueryString["SPAppWebUrl"]);
accessToken = TokenHelper.GetAccessToken(contextToken, sharepointUrl.Authority).AccessToken;
// Pass the access token to the button event handler.
Button1.CommandArgument = accessToken;
protected void Button1_Click(object sender, EventArgs e)
// Retrieve the access token that the Page_Load method stored
// in the button's command argument.
string accessToken = ((Button)sender).CommandArgument;
if (IsPostBack)
sharepointUrl = new Uri(Request.QueryString["SPAppWebUrl"]);
// REST/OData URL section
string oDataUrl = "/_api/Web/lists/getbytitle('Diagrams In Idea Generator')/items?$select=Title,Diagram,SharingStatus";
// HTTP Request and Response construction section
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sharepointUrl.ToString() + oDataUrl);
request.Method = "GET";
request.Accept = "application/atom+xml";
request.ContentType = "application/atom+xml;type=entry";
request.Headers.Add("Authorization", "Bearer " + accessToken);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// Response markup parsing section
XDocument oDataXML = XDocument.Load(response.GetResponseStream(), LoadOptions.None);
XNamespace atom = "http://www.w3.org/2005/Atom";
XNamespace d = "http://schemas.microsoft.com/ado/2007/08/dataservices";
XNamespace m = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";
List<XElement> entries = oDataXML.Descendants(atom + "entry")
.Elements(atom + "content")
.Elements(m + "properties")
.ToList();
var entryFieldValues = from entry in entries
select new
Character = entry.Element(d + "Title").Value,
Actor = entry.Element(d + "Diagram").Value,
CastingStatus = entry.Element(d + "SharingStatus").Value
GridView1.DataSource = entryFieldValues;
GridView1.DataBind();
Any ideas what I might be doing wrongHi ,
Use the below code
Public string GetAccessToken(){
string sharePointSiteUrlHost = Page.Request["SPHostUrl"].Tostring();
string AccessToken = tokenHelper.GetS2SAccessTokenWithWindowsIdentity(sharePointSiteUrlHost, Request.LogonUserIdentity);
return accessToken;
Than initialize the ClientCOntext with the below Method
private static ClientContext GetClientContextWithAccessTokenString(string targetUrl, object accessToken)
ClientContext clientContext = new ClientContext(targetUrl);
clientContext.AuthenticationMode = ClientAuthenticationMode.Anonymous;
clientContext.FormDigestHandlingEnabled = false;
clientContext.ExecutingWebRequest +=
delegate(object oSender, WebRequestEventArgs webRequestEventArgs)
webRequestEventArgs.WebRequestExecutor.WebRequest.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)";
webRequestEventArgs.WebRequestExecutor.RequestHeaders["Authorization"] =
"Bearer " + accessToken;
return clientContext;
use this clientCOntext and it will work.
Do not use
SharePointContextProvider
Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer -
Hello,
I have a lightswitch web-application in development, which I need to copy from one computer to the other. I have tried doing it both through Git and by simply copying the solution and opening the project on another machine. The project builds without errors,
but when I try to debug it, it opens a web-browser, loads to 100% and pops up an error - Load operation failed for query 'GetAuthenticationInfo'. The remote server returned an error: NotFound.
Now, I have tried repairing Visual Studio on my machine, reinstalling .NET framework and setting <basicAuthentication enabled="false" /> in web.config, yet it still does not run.
When using Fiddler, it shows an error while loading the application - "HTTP/1.1 500 Internal Server Error" , which I honestly don't know what it means.
The application uses ComponentOne and Telerik modules, but they are both installed on both machines.
The application does run perfectly on the original machine, but it is not working on any other one.
Both machines are using Win 8.1 and Visual Studio 2013 Update 4.
I have tried to look this up online, but most people's problem are when they are deploying the app, not just debugging. I would be really happy for any help with this issue.
Thanks!I have the same problem on one of my development machines. Whenever I create a new project, the System.IdentityModel.Tokens.Jwt nuget package is not referenced properly. The project compiles correctly but you are not able to debug as I get the same error
as you.
If you open up your references and there is an error next to any of your references make sure that you correct them. In the case of the jwt reference error, I have to remove the jwt reference and then add it back from the packages folder.
This may not be your problem but could point you in a direction? -
When I connect to the SharePoint site that contains the lists I need to build my query from , Power Query enumerates the list and displays them in the tool. I can click on the system tables and view the records but any table
in the list I created returns this error.
I can connect fine with InfoPath
[DataSource.Error] SharePoint: Request failed: The remote server returned an error: (500) Internal Server Error. (An error occurred while processing this request.)
thank you for your help
Andrew
Hi Andrew. In order for us diagnose this issue, you'll need to capture some network traces using a tool such as Fiddler and share them by sending a Frown.
To capture a trace using Fiddler, start Fiddler, enable the Tools > Fiddler Options > HTTPS > Decrypt HTTPS traffic option, start the capture, reproduce your issue, then stop and save the capture. You can find more information here.
Once you've done that, please send a Frown through the Power Query ribbon and attach the traces.
Thanks,
Ehren -
I am *almost* all the way through provisioning my on premise SP 2013 farm for SharePoint 2013 Workflows. Workflow manager is installed alongside Service Bus. Workflow Manager client is installed on the SP servers. I built a new simple list-based
workflow in SP Designer 2013, saved it, and published it without any errors. However, when I go back to the list in my portal and try to run the workflow, I get the "Sorry, something went wrong" page, and the logs say this:
05/15/2013 12:41:05.07 w3wp.exe (0x071C) 0x085C SharePoint Foundation
Runtime tkau Unexpected System.Net.WebException: The remote server returned an error: (500) Internal Server
Error. at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.End(IAsyncResult result) at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest
request, T content) 27be1b9c-f990-f096-34a8-7ac8816bc7a5
05/15/2013 12:41:05.08 w3wp.exe (0x071C) 0x085C SharePoint Foundation
General ajlz0 High Getting Error Message for Exception System.Web.HttpUnhandledException
(0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.Workflow.Client.InternalServerException: Exception thrown from the data layer. For more details, please see the server logs. HTTP headers received from the server
- ActivityId: 0c03f692-8153-43a7-bed5-096214b06168. NodeId: VM22. Scope: /SharePoint/default/d386fdc7-ea7b-4d46-9a39-5c114096eef8/f203a564-e83a-47a3-b11b-e432ac1e6dab. Client ActivityId : 27be1b9c-f990-f096-34a8-7ac8816bc7a5. ---> System.Net.WebException:
The remote server returned an error: (500) Internal Server Error. at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.End(... 27be1b9c-f990-f096-34a8-7ac8816bc7a5
05/15/2013 12:41:05.08* w3wp.exe (0x071C) 0x085C SharePoint Foundation
General ajlz0 High ...IAsyncResult result) at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest
request, T content) --- End of inner exception stack trace --- at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content) at Microsoft.Workflow.Client.InstanceManager.GetInternal(Int32
skip, Int32 count, String workflowName, WorkflowInstanceStatus workflowStatus, IDictionary`2 activationMetadataFilter) at Microsoft.SharePoint.WorkflowServices.FabricWorkflowInstanceProvider.EnumerateByMonitoringParameter(Guid monitoringParameter,
Int32 offset, Int32 count, Boolean checkPermissions) at Microsoft.SharePoint.WorkflowServices.FabricWorkflowInstanceProvider.EnumerateInstancesForListItem(Guid listId, Int32 itemId, Int32 offset) at Microsoft.Sh... 27be1b9c-f990-f096-34a8-7ac8816bc7a5
05/15/2013 12:41:05.08* w3wp.exe (0x071C) 0x085C SharePoint Foundation
General ajlz0 High ...arePoint.WorkflowServices.FabricWorkflowInstanceProvider.EnumerateInstancesForListItem(Guid
listId, Int32 itemId) at Microsoft.SharePoint.WorkflowServices.ApplicationPages.WorkflowPageBase.ConstructStatusArraysWF4(ArrayList running, ArrayList completed, Boolean onlyMyWorkflows) at Microsoft.SharePoint.WorkflowServices.ApplicationPages.WorkflowPage.ConstructStatusArrays()
at Microsoft.SharePoint.WorkflowServices.ApplicationPages.WorkflowPage.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStages... 27be1b9c-f990-f096-34a8-7ac8816bc7a5
05/15/2013 12:41:05.08* w3wp.exe (0x071C) 0x085C SharePoint Foundation
General ajlz0 High ...AfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 27be1b9c-f990-f096-34a8-7ac8816bc7a5
05/15/2013 12:41:05.08 w3wp.exe (0x071C) 0x085C SharePoint Foundation
General aat87 Monitorable 27be1b9c-f990-f096-34a8-7ac8816bc7a5
Some sort of "general server error" returns a 500 code, but I can't tell from this what the problem(s) might be. Has anyone seen this before?
Thanks.Go to the server running Workflow Manager and open the Event Viewer; Applications and Services Logs; Microsoft-Workflow; Operational; and look for the underlying error. In our case, the CU for Workflow Manager did something to the SQL permissions and
we ended up using the workaraound described here:
http://social.msdn.microsoft.com/Forums/windowsazure/en-US/054d2a58-8847-4a6a-b1ab-05a79f49fe65/workflow-manager-cumulative-update-february-error?forum=wflmgr
Joe
Maybe you are looking for
-
My iPhone 4s shuts down at least once a day, usually after I used it or when I'm not using it at all. It will not turn back on unless I reset it (by pressing home/power buttons) and when it turns back on, it runs like nothing happened. I have tried e
-
Looking for a specific applications for iphone
I heard there's an application that you can use as a remote control for your home audio. It's supposed to let you select music from your itunes to play on home speakers. Does anyone know what it's called.
-
Since the MAC Mini has a slot for CD insertion I cannot visually tell if
Since this MAC Mini has a slot for inserting CDs how can I tell if it will accept and read video dics that are routinely 3 1/2 inches in diameter? These are discs used in MINI DVD camcorders.
-
Seperate NT service for App server and Process Scheduler
Is it possible to create a separate NT service for App server and Process Schedule for the same environment? Everytime i need to shutdown either App Domain or Prcs Domain (not both) using service, it brings down both. I could use psadmin but services
-
In my network preferences when I have "Location: Automatic" selected, my AirPort tab's "By Default Join" only allows me to select "A specific network". If I create a new location "Work" I can select "Automatic" and "Preferred Networks". Is this the w