为什么我看不到我的海洋插件

发布于 2024-11-27 03:02:00 字数 1768 浏览 1 评论 0原文

我一直试图弄清楚为什么我的模块没有加载,但我没有看到任何明显的错误消息。 这是一个非常基本的设置(还没有什么花哨的) 这是我的模块定义:

 public class MyModule : IModule
 {
    public void Disintegrate()
    {
    }

    public void Initialize()
    {
        CoreLogger.Info("Starting my module ");
    }

    public void Integrate()
    {
        // Register MyModuleProcess
        MyModuleProcess mymoduleprocessInstance = new MyModuleProcess();
        PetrelSystem.ProcessDiagram.Add(mymoduleprocessInstance , "Plug-ins");

    }

    public void IntegratePresentation()
    {

    }

    public void Dispose()
    {

    }
}

我的过程也非常简单:

  class MyModuleProcess: Process
{
    /// <summary>
    /// Constructor.
    /// </summary>
    public MyModuleProcess() : base("MyModuleProcess")
    {
    }

    #region Process overrides

    /// <summary>
    /// Creates the UI of the process.
    /// </summary>
    /// <returns>the UI contol</returns>
    protected override System.Windows.Forms.Control CreateUICore()
    {
        return new MyModuleProcessUI(this);
    }

    /// <summary>
    /// Runs when the process is activated in Petrel.
    /// </summary>
    protected override sealed void OnActivateCore()
    {
        base.OnActivateCore();
    }
    /// <summary>
    /// Runs when the process is deactivated in Petrel.
    /// </summary>
    protected override sealed void OnDeactivateCore()
    {
        base.OnDeactivateCore();
    }

    #endregion
}

我的配置文件条目是:

<add moduleType="MyModulePlugin.MyModule, MyModulePlugin,Version=1.0.0.0,Culture=neutral, PublicKeyToken=xxxxxxxxxxx"/>

Petrel 加载正常,我没有收到任何错误消息,但我在插件文件夹下看不到我的过程,任何想法?

谢谢

I am stuck trying to figure why my module is not loading but I don't see any obvious error message.
It is a very basic setup (nothing fancy yet)
Here is my module definition :

 public class MyModule : IModule
 {
    public void Disintegrate()
    {
    }

    public void Initialize()
    {
        CoreLogger.Info("Starting my module ");
    }

    public void Integrate()
    {
        // Register MyModuleProcess
        MyModuleProcess mymoduleprocessInstance = new MyModuleProcess();
        PetrelSystem.ProcessDiagram.Add(mymoduleprocessInstance , "Plug-ins");

    }

    public void IntegratePresentation()
    {

    }

    public void Dispose()
    {

    }
}

And my process is also very simple :

  class MyModuleProcess: Process
{
    /// <summary>
    /// Constructor.
    /// </summary>
    public MyModuleProcess() : base("MyModuleProcess")
    {
    }

    #region Process overrides

    /// <summary>
    /// Creates the UI of the process.
    /// </summary>
    /// <returns>the UI contol</returns>
    protected override System.Windows.Forms.Control CreateUICore()
    {
        return new MyModuleProcessUI(this);
    }

    /// <summary>
    /// Runs when the process is activated in Petrel.
    /// </summary>
    protected override sealed void OnActivateCore()
    {
        base.OnActivateCore();
    }
    /// <summary>
    /// Runs when the process is deactivated in Petrel.
    /// </summary>
    protected override sealed void OnDeactivateCore()
    {
        base.OnDeactivateCore();
    }

    #endregion
}

and my config file entry is :

<add moduleType="MyModulePlugin.MyModule, MyModulePlugin,Version=1.0.0.0,Culture=neutral, PublicKeyToken=xxxxxxxxxxx"/>

Petrel loads ok, I don't get any error message, but I don't see my process under the plug-ins folder, any ideas?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甜味拾荒者 2024-12-04 03:02:00
  1. 您确定修改了正确的 petrel.exe.config
  2. 您是否将文件夹添加到探测路径中?然而,如果这是真的,你会得到一个错误,但只是一个想法。
  1. Are you sure you modified the correct petrel.exe.config
  2. Did you add your folder to the probing path? You would get an error however if this was true, but an idea.
花期渐远 2024-12-04 03:02:00

我的解决方案可能会对已签署程序集的人有所帮助。我既无法在 Petrel 中看到我的插件,也无法调试我的 VS 项目。

经过过去两天的大量绞尽脑汁后,我通过执行以下简单步骤解决了同样的问题:

  1. 转到 Visual Studio 项目属性。
  2. 转到“签名”选项卡。
  3. 如果选中“仅延迟标志”选项,则取消选中该选项。
  4. 现在运行您的项目,它应该可以工作。我为我工作。

My solution might help people who have signed the assembly. I was neither able to see my plug-in in Petrel nor able to debug my VS project.

After lot of head scratching for the past two days, I was able to resolve the same issue by doing the following simple steps:

  1. Go to your Visual Studio project properties.
  2. Go to the "Signing" tab.
  3. Uncheck "Delay sign only" option if it is checked.
  4. Now run your project and it should work. I worked for me.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文