【问题标题】:excel add ins | on manifest loading showing error on desktop excelexcel插件 |在清单加载时在桌面 excel 上显示错误
【发布时间】:2021-11-30 04:30:56
【问题描述】:

我使用 office.js 和 react-fabric UI 创建了 excel 插件。我创建了清单并使用以下命令进行了验证:npx --ignore-existing office-addin-manifest validate manifest.xml 它看起来不错,没有问题。当我在桌面 excel 中上传清单时,它在 excel 上显示以下错误。虽然它没有阻止任何插件功能,但它给用户留下了错误的印象。 PFA SS 错误:“加载插件时出错”

单击功能区按钮时,它按预期工作,但在 excel 底部显示清单加载错误。

PSB 是我的清单文件,请帮助确定导致此错误的原因,因为我们需要向客户发布应用程序,但由于此错误,它会导致我们的发布受阻。

    <?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" 
    xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" 
    xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
    <!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->
    <!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
    <Id>565764A6-0F6E-4D98-A1EF-39B86F13D169</Id>
    <!--Version. Updates from the store only get triggered if there is a version change. -->
    <Version>1.0.0.0</Version>
    <ProviderName>Office Developer Education Team.</ProviderName>
    <DefaultLocale>en-US</DefaultLocale>
    <!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
    <DisplayName DefaultValue="Contoso Data Importer" />
    <Description DefaultValue="Get started with extracting your data. Add in a dataset to your workbook."/>
    <!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
    <IconUrl DefaultValue="https://localhost:8060/assests/icon-32.png" />
    <HighResolutionIconUrl DefaultValue="https://localhost:8060/assests/icon-32.png"/>
    <!--If you plan to submit this add-in to the Office Store, uncomment the SupportUrl element below-->
    <!--<SupportUrl DefaultValue="[Insert the URL of a page that provides support information for the app]">-->
    <!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
    <!-- <SupportUrl DefaultValue="https://www.contoso.com/help"/> -->
    <AppDomains>
        <AppDomain>https://localhost:8060</AppDomain>
    </AppDomains>
    <!--End Basic Settings. -->
    <!--Begin TaskPane Mode integration. This section is used if there are no VersionOverrides or if the Office client version does not support add-in commands. -->
    <Hosts>
        <Host Name="Workbook" />
    </Hosts>
    <Requirements>
        <Sets DefaultMinVersion="1.1">
            <Set Name="SharedRuntime" MinVersion="1.1"/>
        </Sets>
    </Requirements>
    <DefaultSettings>
        <SourceLocation DefaultValue="https://localhost:8060/#/index.html" />
    </DefaultSettings>
    <!-- End TaskPane Mode integration.  -->
    <Permissions>ReadWriteDocument</Permissions>
    <!-- Begin Add-in Commands Mode integration. -->
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
        <!-- The Hosts node is required. -->
        <Hosts>
            <!-- Each host can have a different set of commands. -->
            <!-- Excel host is Workbook, Word host is Document, and PowerPoint host is Presentation. -->
            <!-- Make sure the hosts you override match the hosts declared in the top section of the manifest. -->
            <Host xsi:type="Workbook">
                <Runtimes>
                    <Runtime resid="ContosoAddin.Url" lifetime="long" />
                </Runtimes>
                <AllFormFactors>
                    <ExtensionPoint xsi:type="CustomFunctions">
                        <Script>
                            <SourceLocation resid="ContosoAddin.Url"/>
                        </Script>
                        <Page>
                            <SourceLocation resid="ContosoAddin.Url"/>
                        </Page>
                        <Metadata>
                            <SourceLocation resid="ContosoAddin.Url"/>
                        </Metadata>
                        <Namespace resid="Functions.Namespace"/>
                    </ExtensionPoint>
                </AllFormFactors>
                <!-- Form factor. Currently only DesktopFormFactor is supported. -->
                <DesktopFormFactor>
                    <!--"This code enables a customizable message to be displayed when the add-in is loaded successfully upon individual install."-->
                    <GetStarted>
                        <!-- Title of the Getting Started callout. resid points to a ShortString resource -->
                        <Title resid="GetStarted.Title"/>
                        <!-- Description of the Getting Started callout. resid points to a LongString resource -->
                        <Description resid="GetStarted.Description"/>
                        <!-- Point to a url resource which details how the add-in should be used. -->
                        <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
                    </GetStarted>
                    <!-- Function file is a HTML page that includes the JavaScript where functions for ExecuteAction will be called.
            Think of the FunctionFile as the code behind ExecuteFunction. -->
                    <FunctionFile resid="ContosoAddin.Url" />
                    <!-- PrimaryCommandSurface is the main Office Ribbon. -->
                    <ExtensionPoint xsi:type="PrimaryCommandSurface">
                        <!-- Use OfficeTab to extend an existing Tab. Use CustomTab to create a new tab. -->
                        <CustomTab id="ShareTime">
                            <Group id="LoginGroup">
                                <Label resid="LoginGroup.Label"/>
                                <Icon>
                                    <bt:Image size="16" resid="LGButton.Icon"/>
                                    <bt:Image size="32" resid="LGButton.Icon"/>
                                    <bt:Image size="80" resid="LGButton.Icon"/>
                                </Icon>
                                <Control xsi:type="Button" id="BtnLoginService">
                                    <Label resid="BtnLoginService.Label" />
                                    <Supertip>
                                        <!-- ToolTip title. resid must point to a ShortString resource. -->
                                        <Title resid="BtnLoginService.Label" />
                                        <!-- ToolTip description. resid must point to a LongString resource. -->
                                        <Description resid="BtnLoginService.Tooltip" />
                                    </Supertip>
                                    <Icon>
                                        <bt:Image size="16" resid="LGButton.Icon"/>
                                        <bt:Image size="32" resid="LGButton.Icon"/>
                                        <bt:Image size="80" resid="LGButton.Icon"/>
                                    </Icon>
                                    <!-- This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFunction or ShowTaskpane. -->
                                    <Action xsi:type="ExecuteFunction">
                                        <FunctionName>btnloginservice</FunctionName>
                                    </Action> 
                                </Control>
                                <Control xsi:type="Button" id="BtnLogoutService">
                                    <Label resid="BtnLogoutService.Label" />
                                    <Supertip>
                                        <!-- ToolTip title. resid must point to a ShortString resource. -->
                                        <Title resid="BtnLogoutService.Label" />
                                        <!-- ToolTip description. resid must point to a LongString resource. -->
                                        <Description resid="BtnLogoutService.Tooltip" />
                                    </Supertip>
                                    <Icon>
                                        <bt:Image size="16" resid="SignOutButton.Icon"/>
                                        <bt:Image size="32" resid="SignOutButton.Icon"/>
                                        <bt:Image size="80" resid="SignOutButton.Icon"/>
                                    </Icon>
                                    <!-- This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFunction or ShowTaskpane. -->
                                    <Action xsi:type="ExecuteFunction">
                                        <FunctionName>btnlogoutservice</FunctionName>
                                    </Action>
                                    <Enabled>false</Enabled>
                                </Control>
                            </Group>
                            <Label resid="CommandsGroup.Label"/>
                        </CustomTab>
                    </ExtensionPoint>
                </DesktopFormFactor>
            </Host>
        </Hosts>
        <!-- You can use resources across hosts and form factors. -->
        <Resources>
            <bt:Images>             
                <bt:Image id="LGButton.Icon" DefaultValue="https://localhost:8060/assests/log_in.png" />
                <bt:Image id="SignOutButton.Icon" DefaultValue="https://localhost:8060/assests/log_out.png" />
            </bt:Images>
            <bt:Urls>       
                <bt:Url id="ContosoAddin.Url" DefaultValue="https://localhost:8060/#/index.html"/>
                <bt:Url id="LGButton.Url" DefaultValue="https://localhost:8060/#/login" />
                <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
            </bt:Urls>
            <!-- ShortStrings max characters==125. -->
            <bt:ShortStrings>       
                <bt:String id="GetStarted.Title" DefaultValue="Contoso Data Importer add-in has loaded successfully." />
                <bt:String id="Functions.Namespace" DefaultValue="CONTOSO"/>
                <bt:String id="BtnLoginService.Label" DefaultValue="Sign in"/>
                <bt:String id="BtnLogoutService.Label" DefaultValue="Sign out"/>
                <bt:String id='StartupGroup.Label' DefaultValue='Contoso Data Importer Services'/>
                <bt:String id='LoginGroup.Label' DefaultValue='Authentication'/>
                <bt:String id='FeedbackGroup.Label' DefaultValue='Let us know'/>
                <bt:String id="CommandsGroup.Label" DefaultValue="CONTOSO DATA"/>
            </bt:ShortStrings>
            <!-- LongStrings max characters==250. -->
            <bt:LongStrings>
                <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Get files stored on OneDrive" />
                <bt:String id="GetStarted.Description" DefaultValue="Get going by opening CONTOSO importer TAB on the Ribbon." />
                <bt:String id="BtnLoginService.Tooltip" DefaultValue="Please sign in "/>
                <bt:String id="BtnLogoutService.Tooltip" DefaultValue="Please sign out"/>
            </bt:LongStrings>
        </Resources>
    </VersionOverrides>
    <!-- End Add-in Commands Mode integration. -->
</OfficeApp>

【问题讨论】:

  • 您是否在 Office 网页版或 Office for Mac 上收到错误消息?还是仅在 Windows 上?另外,“桌面 Excel”是指一次性购买还是 Microsoft 365 订阅版本?
  • “加载加载项出错”可能与您的加载项无关,可能是加载项在缓存中导致无法加载。您可以清除Windows上的office缓存(%LOCALAPPDATA%\Microsoft\Office\16.0\Wef),看看错误是否仍然存在。
  • @Rick Kirkham,仅在 Windows 桌面 excel、Microsoft 365 订阅版本的 Office 上出现错误。没有在网上办公。
  • @xiaochun-Microsoft,是的,也尝试过清除缓存,但仍然是同样的问题。
  • @Rick Kirkham,如果我遗漏了什么,请告诉我。提前致谢。

标签: excel office365 office-js office-addins office-fabric


【解决方案1】:

通过在清单文件中的标记下方评论清单上传错误已解决。

<!-- <AllFormFactors>
                <ExtensionPoint xsi:type="CustomFunctions">
                    <Script>
                        <SourceLocation resid="ContosoAddin.Url"/>
                    </Script>
                    <Page>
                        <SourceLocation resid="ContosoAddin.Url"/>
                    </Page>
                    <Metadata>
                        <SourceLocation resid="ContosoAddin.Url"/>
                    </Metadata>
                    <Namespace resid="Functions.Namespace"/>
                </ExtensionPoint>
            </AllFormFactors> -->

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 1970-01-01
    相关资源
    最近更新 更多