在Office加载项清单中指定〜remoteAppUrl的值 [英] Specify value for ~remoteAppUrl in an Office add-in manifest

查看:184
本文介绍了在Office加载项清单中指定〜remoteAppUrl的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用新框架.项目模板中的清单使用~remoteAppUrl表示Web文件的位置.它在开发期间效果很好,但是要发布到Office商店,我需要那里的生产URL.如果我将生产URL保存到清单,则在调试过程中会使用生产服务器,因此不会显示本地更改.

I'm writing an add-in for Outlook using the new framework. The manifest in the project template uses ~remoteAppUrl to represent the location of the web files. It works great during development, but to publish to the Office Store I need the production URL there. If I save the production URL to the manifest, the production server gets used during debugging, and so local changes don't show up.

文档中提到在调试过程中Visual Studio会填充此值:

The documentation mentions Visual Studio filling in this value during debugging:

接下来,Visual Studio执行以下操作:
1.通过将〜remoteAppUrl令牌替换为起始页的标准地址,来修改XML清单文件的SourceLocation元素(例如, http://localhost/MyAgave.html ).

Next, Visual Studio does the following:
1. Modifies the SourceLocation element of the XML manifest file by replacing the ~remoteAppUrl token with the fully qualified address of the start page (for example, http://localhost/MyAgave.html).

是否存在一种内置方法,可以使Visual Studio在适当的时间(在Office Store提交之前/期间)填写生产URL,而不中断调试?

Is there a built-in way to have Visual Studio fill in the production URL at the appropriate time (before/during Office Store submittal), and not break debugging?

推荐答案

是的,有一种内置的方法可以使Visual Studio用您选择的目标URL替换~remoteAppUrl符号参考标记.

Yes, there is a built-in way to have Visual Studio replace the ~remoteAppUrl symbolic reference token by the target URL of your choice.

  1. 从Visual Studio中,访问加载项的发布..."选项 项目,然后单击打包加载项"按钮
  2. 然后您可以在弹出的模式对话框中输入URL
  3. 然后触发构建,该构建会将URL注入到产生的清单XML文件中
  4. Windows资源管理器窗口将方便地打开以显示 产生的文件.
  1. From Visual Studio, access the "Publish..." option of the add-in project, then click on the "Package the add-in" button
  2. You can then enter the URL in the modal dialog that pops up
  3. A build is then triggered that will inject the URL in the produced Manifest XML file
  4. A Windows Explorer window will conveniently open to show the produced file.

以下方法不是内置的,但也可能有用.

The following ways are not built-in but may be useful as well.

如果要在自动构建中使用它,则需要为构建参数IsPackaging(True)和RemoteAppUrl指定值.

If you want this in an automated build, you need to specify values for the build parameters IsPackaging (True) and RemoteAppUrl.

如果您希望在标准的Visual Studio Build中使用它,则考虑到Visual Studio无法提供一种简便的方法来指定Build参数(请参阅

If you want this in the standard Visual Studio Build, given that Visual Studio does not provide an easy way to specify Build parameters (see How to emulate /p msbuild parameter in Visual Studio build?) you will need to edit your project file to set the values of the same build parameters. For instance like this:

...
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    ...
    <IsPackaging>True</IsPackaging>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    ...
    <RemoteAppUrl>https://localhost:44300</RemoteAppUrl>
  </PropertyGroup>
  ...  
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    ...
    <RemoteAppUrl>https://your.own.url</RemoteAppUrl>
  </PropertyGroup>
...

这篇关于在Office加载项清单中指定〜remoteAppUrl的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆