0

我正在为 scvmm 编写一个插件,但我不知道为什么会这样:

这是我未编译的 add-in.dll:

[AddIn("Backup HyperV VM")]
public class BackupHyperVVM : ActionAddInBase
{
    public override bool CheckIfEnabledFor(IList<ContextObject> contextObjects)
    {
        if (contextObjects != null && contextObjects.Count > 0)
            return true;

        return false;
    }

    public override void PerformAction(IList<ContextObject> contextObjects)
    {

    }

    private void execPSS(string param) //Execute a powershell script within the SCVMM -- need to make shure I run it on the right host
    {
        PowerShellContext.ExecuteScript<ServerConnection>(param,
            (items, error) =>
            {
                //code to set server info here
                if (error == null)
                {
                    //on Success
                }
                else
                {
                    //on Error
                }
            });
    }
}

这是 manifest.xml:

<ConsoleAddIn
  xmlns="urn:VMM-AddIns-v1-CTP"
  Name="VMM Backup Add-In"
  Version="0.0.1.0"
  Author="..."
  Description="This Add-In (once finished) provides the user with a GUI solution to backup and restore VMs from a Hyper-V host."
  FolderName="BackupAddIn"
  TrustLevel="Full">
  <ActionAddIn
    Name="Backup VMs Add-In"
    Contexts="Cluster"
    AssemblyName="add-in.dll"
    ShowInContextMenu = "True"
    ActionType="Code"    
    Icon="Ico.ico">
    <ButtonLabel>
      Backup VM
    </ButtonLabel>
  </ActionAddIn>
</ConsoleAddIn>

当我压缩文件并尝试加载加载项时,出现此错误(我将其翻译自德语):

在程序集“加载项”中找不到加载项组件“备份 VM 加载项”。可能原因: 1. 插件的属性“名称”与插件类中属性“插件”中定义的名称不匹配。2. Add-In-Class 不公开。

感谢您的帮助..我不知道如何解决这个问题,即使是文档也无法帮助我。

4

1 回答 1

0

据我所知,您需要将清单条目从 AssemblyName="add-in.dll" 更改为 AssemblyName="BackupHyperVVM"。

于 2014-11-21T21:21:31.270 回答