Testing And Deploying An Office 365 Add-In From Network Share

In this article, I will show you how you can load an Office 365 add-in from a network share for testing or live deployment.

If you are a developer who builds add-ins for Office 365, then you need to test those before deployment; and if you are developing for enterprise users then they need to access your add-ins after rollout.

A network share (sharing your add-in from a network drive) is the easiest possible way for both of that. Read this interesting article where I show how to test and deploy Office 365 add-ins from a network share.

Prerequisites

  • Either:
    • Visual Studio 2015 or
    • Visual Studio 2017 (with Office Developer Tools)
    • Visual Studio Code (with Yeoman Office generator a.k.a. YO Office!)

  • Office 365 add-in manifest (XML file)
  • A web server running your Office 365 add-in (web component)

Getting started

If you have already created an Office 365 add-in, then you can skip this “Getting Started” section and jump directly to the next “Publish, Test & Deploy” section.

Create an Office 365 add-in using tools I have mentioned in prerequisites. Read the below section for how to do that.

  • Visual Studio 2017:
  • Visual Studio 2015:
    • Open VS 2015 then click “New Project” and select “App for Office” under “Office/SharePoint” templates.

      Office development

      Give proper project name and click “Ok” button in the above dialog.

      Select “Task pane” from the next dialog.

      Office development

      Click "Next" and select Excel from the next popup.

      Office development

      Click “Finish” and you are done!
  • Visual Studio Code with Yeoman Office Project Generator

    • Follow the instructions on Office Developer GitHub page here.

Publish, Test & Deploy

You can publish your Office 365 add-in web project on either IIS Server or on Azure. For deploying web app on Azure, read another author’s article here.

For deploying web app on IIS Server, follow instructions here. Or you can simply test it by pressing F5 from Visual Studio and let it run until you finish testing.

For showing you further instructions in this article, I have deployed my add-in web project on Azure. All you need now is the URL on which your add-in web project is deployed. You need to configure it in the add-in manifest XML file.

Go to the Solution Explorer in VS 2017 and open the file location of the manifest file.

Office development

 

All you need is a copy of this manifest.xml file. Copy it and paste it on any network share available for testing. I have shared it under “ExcelWebAddIn2Manifest” network share for my testing.

Open the manifest XML file in VS 2017 or any XML editor or simply in notepad, find “SourceLocation”.

Office development

 

You need to change the “DefaultValue” to the URL on which you deployed your add-in web app.

I have changed its value to point to my deployment URL:

Office development

 

That’s the only change you need to make. Now let’s add this manifest file in Excel to see our add-in working.

Open Excel, create a new blank workbook. Go to File -> Options -> Trust Center -> Trust Center Settings:

Office development

 

Go to “Trusted Add-in Catalogs”, enter network share path in “Catalog URL”, then click “Add catalog”:

Office development

 

Select “Show in Menu” checkbox, then click “Ok”:

Office development

 

Once you click the Ok button, you will be shown the following message:

Office development

 

Click Ok and close all dialogs, then close Excel and start it again. Create a new workbook.

Go to Insert ribbon then click “Store”:

Office development

 

Click “Shared Folder” link, and you will see your add-in. If not, then try clicking refresh and you will see this:

Office development

 

Select the add-in and click add button.

Excel will load the add-in and show you the message that it has loaded:

Office development

 

Click on “Show Taskpane” and your add-in will be loaded:

Office development

 

Congratulations! Your Office 365 add-in is now ready to use. You can use the above steps for testing your add-in or while deploying in live environment too.

That’s it for this article. Happy learning!

You can read more of my articles on Office 365 development here.