I'm developing a report for Navision 2009 SP1 (Classic Client), where the need for extra functionality unavailable in NAV has arisen.
I have created a COM dll in C#, installed it (using InstallShield "free" vs version) and created an automation variable in NAV. The class and interface are visible and I see the Print method, but when I try to CREATE the variable, I get the following error:
"Could not create an instance of the OLE control or Automation server identified by..... Check that the OLE control or Automation server is correctly installed and registered."
This is the code (just trying to get a connection going):
[ComVisible(true), Guid("080a97fb-321c-4a2f-b948-dd52ce263415"), InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface IPrinterTest
{
[DispId(1)]
bool Print(string test, string bytesInStringRepresentation);
}
[ClassInterface(ClassInterfaceType.None), ComVisible(true), Guid("8d7b85a9-1a20-4ea0-a7d4-decf26632eee"), ProgId("Printer.PrinterTest")]
public class PrinterTest : IPrinterTest
{
public PrinterTest()
{
}
public bool Print(string test, string bytesInStringRepresentation)
{
return true;
}
}
The production environment only has .NET Framework Client Profile (3.5 and 4.0), this means that Regasm is available (in 4.0) and that gacutil is not.
I'm assuming that there's something wrong with my code and not InstallShield, since the dll is available for selection in Navision,- and that the issue arises when I try to create the nav automation variable.
Best regards Marcus
CREATE(NameAutomationVariable)
? – Jonathan Bravetti