I've built an Excel JS Task Pane add-in using the WoodGrove Expense Trends sample and have validated that it runs correctly in Excel 2016 on my machine. However, when I go to Excel Online and try to add the add-in (via uploading the manifest from my machine), I get "Your add-in manifest is not valid."
I'm not sure what it is about this manifest that's valid on my machine but not in Excel Online.
Anyone encountered this before or have any diagnosis ideas? It's somewhat akin to banging my head into a wall at this point.
Taking a guess from looking at the manifest, I would guess that by "runs correctly in Excel 2016 on my machine", you mean that you can "F5" in Visual Studio and it runs correctly. Is that true?
Assuming my assumption is true... the reason it works on desktop through Visual Studio is that VS does a special F5 process where it automatically substitutes the relative web paths with the spun-up IIS location. But the manifest itself is not actually "valid" in that it doesn't have real URLs -- just things like "~remoteAppUrl/App/Auth/About.html" instead of "https://localhost:3000/App/Auth/About.html".
Two things you can do:
Since you already are in Visual Studio, and if you have an Office 365 for Business tenant you could use the actual built-in feature for debugging in Excel Online. Just open the properties pane for the manifest project, and set the start action to Internet Explorer or Chrome. There is a brief mention of this on https://dev.office.com/docs/add-ins/get-started/create-and-debug-office-add-ins-in-visual-studio, search for "start action".
As a more generic approach that works for other hosts (Word, PPT), and that doesn't require an Office 365 for Business account (regular OneDrive consumer would do), follow the steps outlined on my answer at https://stackoverflow.com/a/33155794/678505.
来源:https://stackoverflow.com/questions/40227074/excel-js-add-in-works-in-excel-but-not-excel-online