我正在尝试创建一个新的插件,但该插件未显示在 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 = "[email protected]", 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 作为依赖项。
您的代码中没有错误。您是否编译过本教程中的 HelloWorld 示例? https://github.com/G1ANT-Robot/G1ANT.Addon.Tutorials/tree/master/G1ANT.Addon.Command.HelloWorld
记住 1. 解决方案中的所有 dll 应标记为“资源”并将嵌入到您的插件中 2. 您项目的目标.NET Framework应该是4.6.1
我明白了问题所在。 G1ANT.Language.dll 与插件位于同一目录中,它似乎导致了问题。