在程序集|中找不到加载项组件SCVMM加载项SDK

时间:2014-11-20 09:36:46

标签: c# xml add-in system-center

我正在为scvmm编写一个加载项,我不知道为什么会发生这种情况:

这是我未编译的附加组件:

[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.加载项的属性“名称”与加载项中属性“AddIn”中定义的名称不匹配。   2. Add-In-Class不公开。

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

1 个答案:

答案 0 :(得分:0)

从我所看到的,你需要从AssemblyName =&#34; add-in.dll&#34;更改清单条目。到AssemblyName =&#34; BackupHyperVVM&#34;。