2

我正在尝试创建一个新插件,但该插件没有显示在 G1ANT Studio 的插件菜单中。甚至从市场安装的其他插件也不会显示。我正在使用最新版本。我曾尝试以管理员身份运行 G1ANT studio。然而这并没有什么区别。

这是我的插件的 Addon.cs 文件:

using System.Collections.Generic;
using System.Linq;
using System.Text;
using G1ANT.Language;

// Please remember to refresh G1ANT.Language.dll in references

namespace G1ANT.Addon.LibreOffice
{
    [Addon(Name = "libreoffice", Tooltip = "Provides commands to automate LibreOffice")]
    [Copyright(Author = "G1ANT LTD", Copyright = "G1ANT LTD", Email = "support@g1ant.com", Website = "www.g1ant.com")]
    [License(Type = "LGPL", ResourceName = "License.txt")]
    [CommandGroup(Name = "calc", Tooltip = "Commands connected with creating editing and generally working on calc")]
    public class LibreOfficeAddon : Language.Addon
    {

        public override void Check()
        {
            base.Check();
            // Check integrity of your Addon
            // Throw exception if this Addon needs something that doesn't exists
        }

        public override void LoadDlls()
        {
            base.LoadDlls();
            // All dlls embeded in resources will be loaded automatically,
            // but you can load here some additional dlls:

            // Assembly.Load("...")
        }

        public override void Initialize()
        {
            base.Initialize();
            // Insert some code here to initialize Addon's objects
        }

        public override void Dispose()
        {
            base.Dispose();
            // Insert some code here which will dispose all unnecessary objects when this Addon will be unloaded
        }
    }
}

该插件还引用了一些其他 DLL 作为依赖项。

4

2 回答 2

3

您的代码中没有错误。您是否曾经编译过本教程中的 HelloWorld 示例?https://github.com/G1ANT-Robot/G1ANT.Addon.Tutorials/tree/master/G1ANT.Addon.Command.HelloWorld

请记住 1. 解决方案中的所有 dll 都应标记为“资源”,并将嵌入到您的插件中 2. 您项目的目标 .NET Framework 应为 4.6.1

于 2019-11-12T11:47:48.557 回答
0

我弄清楚了问题所在。G1ANT.Language.dll 与插件位于同一目录中,这似乎是导致问题的原因。

于 2019-11-12T12:26:30.537 回答