You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Office Addin调试:如何指定manifest文件URL规避证书问题?

解决Office Add-in调试时manifest URL指定问题

方法1:使用office-addin-debugging的--dev-server-url参数

你可以直接在调试命令中指定开发服务器的URL,工具会自动替换manifest文件里的相关地址,无需修改Angular启动命令或manifest源码:

office-addin-debugging start path/to/manifest.xml web --document <url> --dev-server-url https://localhost:4200

这个参数会让调试工具强制使用你指定的URL加载manifest及相关资源,绕开localhost/127.0.0.1的匹配问题。

方法2:生成包含127.0.0.1的SSL证书

如果想继续用127.0.0.1访问,可通过office-addin-dev-certs工具生成包含该IP的证书:

  1. 先卸载现有证书:
office-addin-dev-certs uninstall
  1. 重新生成包含多主机的证书:
office-addin-dev-certs install --hostname 127.0.0.1,localhost

生成完成后,无需修改Angular启动命令,直接用原调试命令即可正常加载127.0.0.1的manifest。

方法3:修改manifest的地址占位符(持久化配置)

在manifest.xml中把固定URL替换为占位符,通过环境变量动态注入地址:

  1. 修改manifest中的SourceLocation等字段:
<SourceLocation DefaultValue="{DEV_SERVER_URL}/taskpane.html" />
  1. 启动调试时通过环境变量指定地址:
DEV_SERVER_URL=https://localhost:4200 office-addin-debugging start path/to/manifest.xml web --document <url>

这种方式适合频繁切换环境的场景,无需每次修改manifest内容。


内容的提问来源于stack exchange,提问作者Dživo Jelić

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 05:12:11