.Net程序集注册和依赖问题

我正在开发一个Excel中的实时数据服务器在C#中。
一切都很好,直到我开始 尝试使用从大会B的类到我的XL服务器(XLS)。
当我在“XLS”类( Assembly A )的代码中实例化“MyClass”( Assembly B )并部署/注册DLL时,从Excel App调用“XLS”将导致#N / A(即“something “ 出错)

因此,问题:如何通过RegAsm部署它使用程序集B中的实例进入程序集使用到Excel作为DLL?

建筑

public class XLS : Excel.IRtdServer { private MyClass MCHammer; public int ServerStart(Excel.IRTDUpdateEvent cb) { try { int i = 0; // When the following line is commented, the next one results in divide-by-zero exception (ok). // but when left effective, I only get "#N/A" on Excel. So my guess is that this is blowing BEFORE Runtime. MCHammer = new MyClass(); i = i / i; //Assert-line : Should blow divide-by-zero exception if executed // This message is dropped to Excel for display // When divide-by-zero line is commented AND NO instantiation of MyClass is made, // This message is displayed in Excel (ie everything went fine) XL_MESSAGE = "ALL COOL"; } catch (Exception ex) { // This is dropped to excel for display when catch block is entered // Only happens when "new MyClass()" line is commented XL_MESSAGE = "EXCEPTION : " + ex.ToString(); } } } 

我想出了Assembly B是x64而Assembly A wad x86。
因此,Excel正在隐藏隐藏的“目标调用exception”(不良格式等)
(我用ac#程序示例使用COM调用模拟debugging东西)

有关我的其他相关问题的更多信息,请点击这里和这里