none
Deployment issues with Mail App RRS feed

  • Question

  • I’m trying to run a Mail App I’ve built with Visual Studio.  When I deploy it with the Deploy Solution command, the Output window shows it as failing.  However, the App is correctly registered as it shows up on the Installed Apps page for the Mailbox I’ve deployed to on my Office 365 Preview Developer account site.  The app also correctly activates, however clicking the tab generates an error: “App Error: Something went wrong and we couldn't start this app. Please try again later or contact your system administrator”.

    I can see with the Network capture IE dev tool that it’s still trying to load the app’s default .html page from my local web server using http://localhost instead of my Office 365 site.  So in the Mail App’s .xml manifest, I changed this:

        <!--<SourceLocation DefaultValue="~remoteAppUrl/Pages/MyApp1.html" />-->

        <SourceLocation DefaultValue="../Pages/MyApp1.html" />

    Same problem.  After looking at the network capture from another test Mail App developed with Napa that successfully loads, I see that it’s pulling from https://legaultdev-5b2aa7a3d9f70b.sharepoint.com/MyNapaApp1/Pages/Default.aspx.

    So the Napa app is clearly reading from the MyNapaApp1.zip file that Napa creates in the “Appins in Testing” list within my SharePoint Dev site.  So I figure I’d try that approach – I delete MyApp1 from the Installed Apps page and upload the .zip file that’s created in the VS project’s bin\Debug\app.publish directory to the App Packages library.  That makes the package available in the “Select an app package” dropdown on the Deploy App launched when I click “new app to deploy” on the Appins in Testing page.  I leave the deploy location to the default https://legaultdev.sharepoint.com and click Deploy, but get the following error:

    Sorry, something went wrong

    The package contains the wrong number of relationships for relationship type 'http://schemas.microsoft.com/sharepoint/2012/app/relationships/package-manifest'. Expected: '1'. Actual: '0'.

    Correlation ID: 07d5f29b-a9f5-c0d3-92a5-fbcb1a53b5fa

    What am I doing wrong?  The instructions here (Using Visual Studio to develop a mail app for Outlook: http://msdn.microsoft.com/en-us/library/office/apps/fp179827.aspx) don’t help either.  Deploying a Mail App is confusing!!!


    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Tuesday, January 8, 2013 5:12 PM

Answers

  • Let me provide a quick overview of how the tools work which might help clarify some questions.
    As Stephen mentions there are two steps to making a mail app work -
    1) Registering the manifest on exchange that points to a website
    2) Hosting a website page that contains the app code
    Both VS and Napa manage this differently -

    In VS when you hit F5 (start debugging):
    VS prompts you for your email credentials. It uses this to install the manifest on your exchange mailbox using the Exchange Webservices API (So you dont have to manually install the app). The manifest installed by VS points to a website location on https://localhost/. This is because VS is hosting your site on IIS Express locally. Its just like debugging any other Web project in VS except that the website is being accessed through the OWA or Outlook interface.

    In Napa when you hit run:
    The prompt for email and password does the same thing to install the manifest on the exchange mailbox automatically. However in this case the manifest instead of pointing to IIS express on localhost it points to your sharepoint dev site associated with Napa - you can think of the dev site as being the equivalent of IIS express hosting your content temporarily to allow you to debug your app.

    All this is tool specific implementation to enable a debug scenario for developers.

    Once you are done with development/debugging and want to deploy your application to end users then you can use the publish command in VS. VS will prompt you for the final location of the website where you will host the content and insert that in the manifest. You can then manually deploy to the website and submit the manifest to marketplace or to your enterprise exchange server.

    The Deploy solution command in VS also seems to be causing some confusion -> Deploy is really a build target that will operate on both the projects the office app and web project. On the office app it will install the manifest on exchange and on the web project it will create the web deploy zip output. As such you shouldnt have to directly use this command as it gets invoked as part of debug or publish. I will take this feedback back to the team about the confusion its causing and we may be able to hide it from the top level menu in the next update to the tools.

    Hope that helps.

    Saurabh

    Saturday, January 12, 2013 1:10 AM
  • Eric,

    There are two distinct pieces to deployment of an Office Mail App. The first is registering the manifest with the Exchange 2013 server. This is the piece that is working for you, and is the reason the app shows up under Installed Apps and the app appears on the message. However, that registration is just that - a registration that such an app ought to exist. It's not until you click on the app on the message that we need the next part - you have to deploy the application's code to a web server, and this server needs to be the same one that your manifest pointed to.

    In my testing with various methods of deploying Mail Apps, that last point is the critical one - if your manifest is pointing to your local server, but you're pushing the app up to a sharepoint or azure server, things won't work as you expect.

    Now - I've not myself succeeded in using Visual Studio to publish an app back to the sharepoint server in the same location Napa publishes to. Clearly it's possible since Napa can do it - I just spent the time to find the appropriate settings yet. But I have managed to publish an app to Azure, by downloading the publish profile from the Azure portal and using that to configure VS to publish the app. I also needed to manually edit my manifest to point at the Azure.

    One thing to note - your application is really just a web page, and you can visit it outside of the context of Outlook/OWA. This is useful in making sure your page is published and confirming the URL. For instance, the Azure based application I published is located here: https://mha.azurewebsites.net/pages/default.html. This is the URL I used in my manifest.

    So - what is your goal here - what (kind of) server do you wish to deploy your application to? If your goal is to publish back to the Sharepoint server that Napa was using I can work to figure out those settings and post back.

    Steve

    Thursday, January 10, 2013 2:50 PM

All replies

  • Hi Eric,

    Thank you for posting in the MSDN Forum.

    I'll try to involve some experts who are more familiar with your issue. This may take some time.

    Thank you for your patience and understanding.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, January 9, 2013 12:04 PM
    Moderator
  • Eric,

    There are two distinct pieces to deployment of an Office Mail App. The first is registering the manifest with the Exchange 2013 server. This is the piece that is working for you, and is the reason the app shows up under Installed Apps and the app appears on the message. However, that registration is just that - a registration that such an app ought to exist. It's not until you click on the app on the message that we need the next part - you have to deploy the application's code to a web server, and this server needs to be the same one that your manifest pointed to.

    In my testing with various methods of deploying Mail Apps, that last point is the critical one - if your manifest is pointing to your local server, but you're pushing the app up to a sharepoint or azure server, things won't work as you expect.

    Now - I've not myself succeeded in using Visual Studio to publish an app back to the sharepoint server in the same location Napa publishes to. Clearly it's possible since Napa can do it - I just spent the time to find the appropriate settings yet. But I have managed to publish an app to Azure, by downloading the publish profile from the Azure portal and using that to configure VS to publish the app. I also needed to manually edit my manifest to point at the Azure.

    One thing to note - your application is really just a web page, and you can visit it outside of the context of Outlook/OWA. This is useful in making sure your page is published and confirming the URL. For instance, the Azure based application I published is located here: https://mha.azurewebsites.net/pages/default.html. This is the URL I used in my manifest.

    So - what is your goal here - what (kind of) server do you wish to deploy your application to? If your goal is to publish back to the Sharepoint server that Napa was using I can work to figure out those settings and post back.

    Steve

    Thursday, January 10, 2013 2:50 PM
  • You raise salient points that I was slowly starting to understand myself!  The confusion lies in how VS seems to be deploying all that is needed to run the app on the target Exchange server.  Indeed, it asks for the mailbox and password - so it's natural to assume the code is being fully deployed to the web and not being used locally!

    I get now that the actually web location has to be changed from local to remote.  And yes - I'm trying to deploying everything to my developer Site in SharePoint.  This is where the documentation fails!  Consider the instructions here:

    Deploying and installing mail apps for testing in Outlook:
    http://msdn.microsoft.com/en-us/library/office/fp142256(v=office.15).aspx

    For the steps to install via EAC:

    • Step 3 is wrong - there is no EXTENSIONS link anywhere - it's organization -> apps
    • Step 6: Browse to the URL? Step 5 says "Add from file"!
    • If the manifest is in SharePoint, where are the web source files to be stored? I've guessed that it's the App Packages library, but adding the .zip file compiled by VS doesn't lead to an exposed manifest file to be used in any of these steps

    The SDK needs to clarify web deployment procedures, locations and requirements, for sure!


    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Thursday, January 10, 2013 4:51 PM
  • Eric,

    Are you looking at an older version of that page? On the page I'm looking at, Step 3 doesn't say Extensions, and step 6 says browse to the file path.

    I think the disconnect on that page is that it assume you're already comfortable deploying web sites, so it skims over that and discusses deploying the manifests instead.

    I'll research what it takes to deploy a web site to sharepoint.

    Steve

    Friday, January 11, 2013 9:36 PM
  • Yes, I was looking at the local help from the SDK.  I see now that the web version is different.

    The disconnect is also sort of with me, seeing how as I learn this platform that Napa used in conjunction with a developer account (which already contains SharePoint) leverages SharePoint for hosting the source files - then assuming without thinking fully through that a VS deployment would default to deploying to SharePoint!

    But yeah - a production release would probably host the Mail App source in a web server (or Azure), not SharePoint. Maybe! I'll have to think about the pros and cons for all.


    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Saturday, January 12, 2013 12:28 AM
  • Let me provide a quick overview of how the tools work which might help clarify some questions.
    As Stephen mentions there are two steps to making a mail app work -
    1) Registering the manifest on exchange that points to a website
    2) Hosting a website page that contains the app code
    Both VS and Napa manage this differently -

    In VS when you hit F5 (start debugging):
    VS prompts you for your email credentials. It uses this to install the manifest on your exchange mailbox using the Exchange Webservices API (So you dont have to manually install the app). The manifest installed by VS points to a website location on https://localhost/. This is because VS is hosting your site on IIS Express locally. Its just like debugging any other Web project in VS except that the website is being accessed through the OWA or Outlook interface.

    In Napa when you hit run:
    The prompt for email and password does the same thing to install the manifest on the exchange mailbox automatically. However in this case the manifest instead of pointing to IIS express on localhost it points to your sharepoint dev site associated with Napa - you can think of the dev site as being the equivalent of IIS express hosting your content temporarily to allow you to debug your app.

    All this is tool specific implementation to enable a debug scenario for developers.

    Once you are done with development/debugging and want to deploy your application to end users then you can use the publish command in VS. VS will prompt you for the final location of the website where you will host the content and insert that in the manifest. You can then manually deploy to the website and submit the manifest to marketplace or to your enterprise exchange server.

    The Deploy solution command in VS also seems to be causing some confusion -> Deploy is really a build target that will operate on both the projects the office app and web project. On the office app it will install the manifest on exchange and on the web project it will create the web deploy zip output. As such you shouldnt have to directly use this command as it gets invoked as part of debug or publish. I will take this feedback back to the team about the confusion its causing and we may be able to hide it from the top level menu in the next update to the tools.

    Hope that helps.

    Saurabh

    Saturday, January 12, 2013 1:10 AM
  • Thanks Saurabh, great overview! Things are totally clear to me now.

    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Monday, January 14, 2013 3:43 PM
  • Info which you give its very useful i would like to know if app is created in local host using vs12 and for publishing web app (without windows azure profile) how to publish it using/on napa? Or any free hosting site for publish web app? And how office app come to know web app is stored on particular site?


    nitin patil

    Saturday, January 18, 2014 5:02 AM