且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Navision自动化C#COM DLL

更新时间:2023-02-08 20:58:46

我们能够解决此问题并在此处共享最终解决方案,以便遇到相同情况的人可能不需要花很多时间来解决这个问题:

We were able to resolve this and sharing the final resolution here so that people who get into the same situation might not need to spend the many hours we put into this:

问题不是向导或界面,而是REGASM的二手版本。 .NET Framework。

The problem was not the guids or interfaces but the used verson of REGASM of the .NET Framework.

由于目标框架为3.5,所以我们假设REGASM的版本也必须< = 3.5,我们还假设必须使用64位框架的REGASM。但是,经过大量的反复试验,我们似乎必须使用的版本是32位v4 REGASM(请参阅下面的用于注册的.bat文件),这解决了所有问题,并且我们的DLL现在很高兴在Navision中使用

Since the target framework was 3.5 we assumed that the version of REGASM also had to be <= 3.5, also we assumed that we had to use the REGASM of the 64-bit Framework. However after a good amount of trial and error it appeared that the version we had to use was the 32bit v4 REGASM (see our used .bat file for registration below), this resolved all issues and our DLL is now happily being used in the Navision client.

SET GACUTIL="C:\Program Files (X86)\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe"
SET REGASM="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\regasm.exe"
%REGASM% OurDll.dll /tlb:OurDll.tlb
%GACUTIL% /i OurDll.dll