Reputation: 21
I'm trying to develop an Word addin following this guide:
https://dev.office.com/docs/add-ins/word/word-add-ins
I made everything identical to the guide, but when i try to open it in Word i get an error:
addin error: We could not initialize this addin
or
addin error: Wrong configuration
I guess there is something wrong in my tag SourceLocation
This is my XML:
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="TaskPaneApp">
<Id>fd3731db-b538-4e32-819f-b09b801894e8</Id>
<Version>1.0.0.0</Version>
<ProviderName>Microsoft</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Boilerplate content" />
<Description DefaultValue="Insert boilerplate content into a Word document." />
<Hosts>
<Host Name="Document"/>
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="http://localhost:8080/boilerplate/home.html" />
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
</OfficeApp>
I've also tryed with the shared folder:
<SourceLocation DefaultValue="\\MyShare\boilerplate\home.html" />
NB: I'm testing in Word Online
Upvotes: 2
Views: 2795
Reputation: 4545
An add-in can only be served via https (SSL) as explained here.
Make sure that you can browse directly the url with your browser https://localhost:8080/boilerplate/home.html
You may have to bypass your browser warning about the certificate or you can install a selfsigned certificate for localhost domain.
When browsing directly to the add-in location url you should have a warning in your browser console:
Warning: Office.js is loaded outside of Office client
When you are back to the web add-in. You need also to make sure that you set up the Office.initialize callback.
Tip: You are right to start developing with Office Online. Keep your browser devtools open and do not forget to disable cache. Acutally, this is no different from regular web development.
Upvotes: 2