Testing and deploying an Office 365 add-in from network share

C-EdzGWUAAAEWCY

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 roll-out.

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 of:
    • 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 below section for how to do that:

VS2015 office project

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

Select “Task pane” from the next dialog:

VS2015 office task pane

Click next and select Excel from the next popup:

VS2015 office project finish

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 simply you can test it by pressing F5 from Visual Studio and let it run till 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:

sol explorer

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 Notepad, find “SourceLocation”:

source loc

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:

defaultvalue

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:

trust center

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

add catalog

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

show in menu

Once you click OK button, you will be shown following message:

restart message

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

Go to Insert ribbon then click “Store”:

store

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

shared folder

Select the add-in and click add button.

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

show task pane

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

add in loaded

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!

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s