locked
Visual Studio error connecting to SharePoint Online RRS feed

  • Question

  • I'm trying to create an app with a workflow in SharePoint online 2013.

    When I try to connect to SharePoint from Visual studio I'm prompted for credentials in a pop up browser from Visual Studio 2012.  When I put in my 365 credentials (onmicrosoft) I receive a generic error: the server encountered an error.  I have an option for help, or go back to site - which brings me to a team site in my developer site.  A similar error occurs when I try to open an app in Visual Studio that I've created in Napa.  I create the app in napa, click open in Visual studio in napa, visual studio opens the project and the app - and then I'm prompted for credentials.  I put in the credentials, and same error.  It then asks me to work offline.   

    I'm not entirely sure where the hangup is or why.  Should I just work offline, publish the app, and then load it back into the apps for testing gallery?  Is there something I'm missing?  Ideally, I'd like to just click publish and have it publish the app back to SharePoint online, particularly if I'm opening it from napa.  I've tried checking my sessions, running visual studio as an admin - nothing seems to work.  Any thoughts to send me forward would be much appreciated.

    Friday, August 9, 2013 1:46 AM

Answers

  • Hi Kakap,

    You're on the right track with #1.  (This is a test tenant.  The root site collection is in wave 14.  My developer site template/collection is in wave 15, however.)  I'm assuming that when you click go back to site, it sends you to the root right?  Try upgrading the root site collection to 2013.

    If you're developing an app in Visual Studio 2012 for SharePoint Online 2013, Visual Studio will try to authenticate to your root site collection.  If this site has not been upgraded, and is in 2010 mode, it will fail.  I believe this partially because SharePoint 2010 doesn't understand 2013 apps.  I'm not sure why Visual Studio won't authenticate to the specific site collection, although I have run into this same issue.

    I've found that upgrading the root site collection solves this issue.

    Good luck!

    • Proposed as answer by Zhao Weida Tuesday, August 13, 2013 10:33 PM
    • Marked as answer by Qiao Wei Sunday, August 18, 2013 8:56 AM
    Monday, August 12, 2013 7:29 PM

All replies

  • Hi,

    What I know you need to use a developer site to develop apps. You can't use Team site to develop apps. There's a subscription called 'Office 365 Developer subscription' for developing apps against Office 365. More details are available at: http://msdn.microsoft.com/en-us/library/fp179924.aspx. More information also at: http://www.sharepointcolumn.com/brief-overview-of-sharepoint-2013-developer-site-template/


    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com>

    Friday, August 9, 2013 1:54 AM
  • I am using the developer site template, which provides the apps for testing library.
    Friday, August 9, 2013 11:50 AM
  • When is this issue happening to you in Visual Studio:  when you hit "F5" (run the project), or even on project creation.  Is this issue still happening to you?  Sometimes there are quick intermittent issues with the dev sites, but those usually get resolved pretty quickly.

    If you're able to log into Napa but are having problems there as well, you can use the "Send Feedback" button (smiley face in upper right of Napa) to report this issue, which should also collect some diagnostics information about your tenant and send it to the Napa folks.  They may be able to use this to diagnose the issue.

    Best of luck!

    - Michael



    Michael Zlatkovsky | Program Manager, Visual Studio Tools for Office & Apps for Office

    Saturday, August 10, 2013 12:56 AM
  • Hi Michael,

    I have no problems with Napa.  I can open an app in Napa, create it, and add it to my SPO (365) developer site.  In Napa I can click on the open in Visual Studio link and it will open the project in Visual studio.  The problem I have is from here, when I try to add an item, or make a change and am prompted for credentials - I get an error (see below).  The same thing occurs when I try to create a project from scratch in Visual Studio, using autohosted or SharePoint hosted for a SharePoint app, and it prompts me for credentials when I go to validate.  If I don't validate, I get prompted for credentials when I try to add certain items, like site columns. 

    I have just verified again, and here is the error and correlation ID:

    An error has occurred on the server.

    Troubleshoot issues with Microsoft SharePoint Foundation.

    Correlation ID:
    6cd7379c-48cf-8065-42dd-25217e05153a

    Date and Time: 8/10/2013 7:52:23 PM

    There are three potentially odd factors that may be related, but I wouldn't necessarily think so.

    1. This is a test tenant.  The root site collection is in wave 14.  My developer site template/collection is in wave 15, however.

    2. I haven't updated to VS update 3, which I just received notice for and am doing now.

    3. Some accounts are federated back to our premises AD, although I'm using a direct onmicrosoft account and license and am a global admin. 

    Sunday, August 11, 2013 3:04 AM
  • Visual Studio Update 3 had no effect
    Sunday, August 11, 2013 12:14 PM
  • Hi Michael,

    I have tried this on another tenant without issue.  It seems to be related to this tenant, specifically, and likely #1 or something else.  I have ruled out #3 as I've attempted outside the corporate network with the same issue, and I am using an onmicrosoft account which is not tied to our ADFS.  If #1 is a known issue, please let me know, of if you have other insight - it is appreciated.

    Monday, August 12, 2013 12:48 AM
  • Hi,

    Can you please do the following?

    1. Login to your Office 365 developer site (You need to have an Office 365 Developer site. For signup, please sign up from here: http://msdn.microsoft.com/en-us/library/fp179924.aspx)
    2. From the developer site click 'build app' tile from the home page. You might be asked to install Napa in the site.
    3. Once you get the Napa tools added to your developer site, launch the app and you will be provided the option to develop apps inside browser.
    4. Develop an app in browser and then click 'Open in Visual Studio' in browser (from left side option).
    5. This will download the app from office 365, download necessary files/updates and open the project in visual studio.

    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com>

    Monday, August 12, 2013 1:04 AM
  • I can do 1-5 without an issue (see above).  When the solution opens in Visual studio, and tries to authenticate back to microsoft online (prompt for credentials) I recieve this error.  I can thus not deploy the app from VS, update the app or add new items without going offline.  Once offline, I cannot add certain items. 

    Monday, August 12, 2013 12:22 PM
  • Hi kakap,

    In order to figure out what the issue is, could you please send me a fiddler trace to dazhao@microsoft.com?

    Note that you will need to enable 'Decrypt HTTPS traffic' in Fiddler by Tools -> Fiddler Options -> HTTPS -> Decrypt HTTPS traffic.

    Thanks,

    -David

    Monday, August 12, 2013 4:58 PM
  • Hi Kakap,

    You're on the right track with #1.  (This is a test tenant.  The root site collection is in wave 14.  My developer site template/collection is in wave 15, however.)  I'm assuming that when you click go back to site, it sends you to the root right?  Try upgrading the root site collection to 2013.

    If you're developing an app in Visual Studio 2012 for SharePoint Online 2013, Visual Studio will try to authenticate to your root site collection.  If this site has not been upgraded, and is in 2010 mode, it will fail.  I believe this partially because SharePoint 2010 doesn't understand 2013 apps.  I'm not sure why Visual Studio won't authenticate to the specific site collection, although I have run into this same issue.

    I've found that upgrading the root site collection solves this issue.

    Good luck!

    • Proposed as answer by Zhao Weida Tuesday, August 13, 2013 10:33 PM
    • Marked as answer by Qiao Wei Sunday, August 18, 2013 8:56 AM
    Monday, August 12, 2013 7:29 PM
  • This worked for me. Same problem initially. Our root site was still 2010, as soon as I upgraded it, SharePoint App development in Visual Studio works. Good pickup

    Brett Morris

    Friday, February 14, 2014 2:13 AM
  • Hello,

    I have the same problem like kakap, but I develop with Visual Studio 2013.

    Our company are very new in SharePoint online. Therefore I need some  informations for our SharePoint  admin. I think this settings can´t be done in the developer site:

    1. Where is this root site collection? 

    2. How can I upgrade this?

    3. What do you mean with #1?

    4. What is wave 14 or 15? Where can I see it?

    Friday, November 14, 2014 8:20 AM
  • Hi Shekra,

    Are your SharePoint sites are all on SharePoint Online? When did you move to it? Could you please share the complete message (or screenshot) of the error you saw?

    Regarding to your questions:

    1. Root site collection is the top level site collection of your SharePoint sites.

    2. If your SharePoint sites are all in SharePoint Online, then it's upgraded automatically by cloud (i.e. by Microsoft)

    3. #1 is this step:  Login to your Office 365 developer site (You need to have an Office 365 Developer site. For signup, please sign up from here: http://msdn.microsoft.com/en-us/library/fp179924.aspx)

    4. "Wave 14" refers to SharePoint 2010, and "wave 15" to SharePoint 2013.

    Thanks,

    Xiaoying


    Xiaoying is a program manager in Microsoft Visual Studio Office Developer Tools team | This post is provided "as-is"

    Friday, November 14, 2014 9:24 PM
  • Hello Xiaoying,

    thank you for your answer.

    Our SharePoint sites are not in SharePoint online. We just want to use SharePoint online for developing SharePoint Apps. But the App will be used in the (normal) SharePoint.
    Another question: The root site is on SharePoint online or in SharePoint?

    These are the steps (sorry I can´t insert pictures now because my account will be checked first)

    1. Menue: File/New/Project
    2. I choose the project "App for SharePoint", Click button OK
    3. Wizzard "New app for SharePoint" appears
    4. I insert my dev-URL and choose "Provider-hosted", Click button "Next"
    5. I choose "ASP.NET MVC Web Application", click button "Next"
    6. I choose "Use Windows Azure Access Control Service (for SharePoint cloud apps), click button "Finish"

    7. Login window for sharepoint online appears
    8. I´m logging-in
    9. On logging window an error text appears: "Error An error occurs on server", with option for help (like kakap)
    10. I close the window
    11. An error window appears with following text:
    "Cannot connect to the SharePoint site. The project will be set to target SharePoint Online. To change the target version, go to the SharePoint tab on the app for SharePoint project´s properties page, and select a different version. Go to the Site URL property in the properties window to change the target SharePoint site.", Click button "OK"

    --> I can work offline

    Wednesday, November 19, 2014 4:32 PM
  • Shekra, the concept of root site collection applies to both SharePoint Online and SharePoint on-prem. On SharePoint Online, it's usually something like https://myspo.sharepoint.com. If the Developer site you use on SharePoint Online for SharePoint development is something like "htpps://myspo.sharepoint.com/sites/dev", then it's not a root site. The current Office Developer Tools do authentication at the root site collection level. The error you see can be caused by the fact that your root site collection version is lower than SharePoint 2013 (which shouldn't be the case if you use SharePoint Online today) or you don't have access to the root site collection. It'd be helpful if you could share a fiddler trace, so that I can see what's the real error behind the scene.

    Thanks,

    Xiaoying

     

    Xiaoying is a program manager in Microsoft Visual Studio Office Developer Tools team | This post is provided "as-is"

    Wednesday, November 19, 2014 6:30 PM
  • Thank you Xiaoying.

    After login this error appears on fiddler

    Error Code: 407 Proxy Authentication Required. Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. (12209)

    mmh... It´s the proxy authentication.

    Thursday, November 20, 2014 1:00 PM
  • Shekra, the error implies that the proxy server in your company prevents your connection from VS pass through. There is a similar issue here with a workaround, but for TFS connection: http://stackoverflow.com/questions/13717815/visual-studio-error-407-proxy-authentication-required. I'm not sure if works for you though, given SPO usually requires a different account.

    Xiaoying is a program manager in Microsoft Visual Studio Office Developer Tools team | This post is provided "as-is"

    Thursday, November 20, 2014 11:46 PM
  • I tried this and another things which I found on internet. But nothing works yet.
    Tuesday, November 25, 2014 7:50 AM
  • The first entries about this issue appears in 2013, we have 2015 now and I still have the same issue (Windows 8.1, VS 2013 with update).

    Any ideas?


    • Edited by MarekIvero Thursday, April 2, 2015 8:39 PM
    Thursday, April 2, 2015 8:37 PM