Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用C#VS2012创建新文档时System.MissingMethodException错误_C#_Visual Studio 2012_Imanage - Fatal编程技术网

使用C#VS2012创建新文档时System.MissingMethodException错误

使用C#VS2012创建新文档时System.MissingMethodException错误,c#,visual-studio-2012,imanage,C#,Visual Studio 2012,Imanage,我正在尝试使用iManager扩展库(iManExt.dll)创建新文档。它在我本地的机器上工作得很好。但当我把它部署到另一台机器上时,即使所有的dll都在那里,它也不能工作。我从desksite收到以下错误 System.MissingMethodException: Method not found: 'System.Type System.Runtime.InteropServices.Marshal.GetTypeFrom CLSID(System.Guid)'. 下面是我创建新文

我正在尝试使用iManager扩展库(iManExt.dll)创建新文档。它在我本地的机器上工作得很好。但当我把它部署到另一台机器上时,即使所有的dll都在那里,它也不能工作。我从desksite收到以下错误

System.MissingMethodException: Method not found: 'System.Type  
System.Runtime.InteropServices.Marshal.GetTypeFrom CLSID(System.Guid)'.
下面是我创建新文档的c#代码

private IManage.IManDocument NewDocumentProfile(IManage.IManFolder aFolder, String aFileName)
{
    IManage.IManDocument NewDocument;

    IMANEXTLib.ImportCmd MyCommand = new IMANEXTLib.ImportCmd();
    IMANEXTLib.ContextItems MyContext = new IMANEXTLib.ContextItems();

    MyContext.Add("ParentWindow", Helper.GetActiveWindow());
    MyContext.Add("ImanDestinationObject", aFolder);

    MyContext.Add("IManExt.Import.KeepCheckedOut", 0);
    MyContext.Add("IManExt.Import.FileName", aFileName);
    MyContext.Add("IManExt.CalledFromIntegration", false);
    MyContext.Add("IManExt.OpenCmd.NoCmdUI", false);

    MyCommand.Initialize(MyContext);
    MyCommand.Update();

    if (MyCommand.Status == (int)IMANEXTLib.CommandStatus.nrActiveCommand)
    {
        MyCommand.Execute();
        NewDocument = MyContext.Item("ImportedDocument");
    }
    else
    {
        NewDocument = null;
    }
    return NewDocument;
}

谢谢你的回答。我解决了这个问题。但是,我不知道为什么会这样。当我将该dll(IMANEXTLib)的嵌入互操作类型属性设置为false时,它可以正常工作。但是当我将其设置为true时,它就不起作用了。

听起来像是目标机器上没有安装COM组件是部署机器上注册的组件/dll吗?