Autodesk Forge:WorkItem 由于 AppPackage 问题而失败

Autodesk Forge: WorkItem failing due to AppPackage Issues

我的 AppPackage 加载失败,我无法在文档中找到确切的答案或错误 message/code。

我通过将它解压缩到我本地计算机上的 "C:\Program Files\Autodesk\ApplicationPlugins" 来测试该包,并且它 runs/loads 正如预期的那样。

AppPackage表示创建成功,我确定是最新版本。

插件是一个 .NET DLL 文件。

错误报告消息

[02/15/2019 18:44:48] Starting work item ffbcfc1ca50546fc9a6372424b2cdae1
[02/15/2019 18:44:48] Start download phase.
[02/15/2019 18:44:48] Start downloading file <CENSORED>.
[02/15/2019 18:44:48] Start preparing AppPackage <CENSORED>.
[02/15/2019 18:44:48] Download bits and install app to local cache.
[02/15/2019 18:44:48] End downloading file <CENSORED>.
[02/15/2019 18:44:48] End download phase.
[02/15/2019 18:44:48] Error: Failed to prepare app package(s).
[02/15/2019 18:44:48] Error: An unexpected error happened during phase Downloading of job.
[02/15/2019 18:44:48] Job finished with result FailedEnvironmentSetup

PackageContents.XML

<?xml version="1.0" encoding="utf-8" ?>
<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="AutoCAD"
                    AppVersion="0.1.0"
                    ProductType="Application"
                    Name="CENSORED"
                    Description="CENSORED"
                    Author="CENSORED"
                    FriendlyVersion="0.1.0"
                    ProductCode="{CENSORED}"
                    UpgradeCode="{CENSORED}"
                    Helpfile="./help.html"
                    Icon="./my-icon.jpeg">

    <CompanyDetails Name="CENSORED" Phone="CENSORED" Email="CENSORED"/>

    <Components>
        <RuntimeRequirements SeriesMin="R22.0" Platform="AutoCAD*" OS="Win64"/>

        <ComponentEntry AppName="CENSORED" Version="0.1.0" ModuleName="./CENSORED.dll" AppType=".Net"
                        AppDescription="CENSORED" LoadOnAutoCADStartup="True">
        </ComponentEntry>
    </Components>

</ApplicationPackage>

Activity 定义: 注意我不得不在这里手动扩展一些内联函数,因为我把它分成了多个部分。如果我有错字,请放心,代码实际上是按语法运行的。

let activity = <CreateActivityRequest>{
            Id: id,
            Version: 1,
            IsPublic: false,
            AppPackages: ['PACKAGE_NAME'],
            Instruction: {Script: 'D6 '},
            RequiredEngineVersion: '22.0',
            Parameters: {
                InputParameters: [{Name: 'HostDwg', LocalFileName: '$(HostDwg)'}],
                OutputParameters: [{Name: 'output', LocalFileName: `output.json`}]
            },
            HostApplication: undefined,
            AllowedChildProcesses: []
        };

AppPackages 列表中的条目:

{
  References: [],
  Resource: '...',
  RequiredEngineVersion: '22.0',
  IsPublic: false,
  IsObjectEnabler: false,
  Version: 1,
  Timestamp: '2019-02-15T19:32:33.527Z',
  Description: '',
  Id: 'CENSORED'
},

请务必仔细检查您是如何压缩上传的 AppPackage 的。如果您查看 zip 文件,请确保您有一个名为 PACKAGE_NAME.bundle 的文件夹,并且 PackageContents.XML 文件位于该 PACKAGE_NAME.bundle 文件夹中。