AnsweredAssumed Answered

Automation Pro license not avilable

Question asked by eddy_muliyanto on Jun 18, 2020
Latest reply on Aug 7, 2020 by eddy_muliyanto

I have this simple script written in C# Visual Studio:

        static void Main(string[] args)
        {
            Console.WriteLine("Start");
            MGCPCB.Application app = (MGCPCB.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("MGCPCB.ExpeditionPCBApplication");
            MGCPCB.Document doc = app.ActiveDocument;
            doc.Validate((new PCB_LIC.Application()).GetToken(doc.Validate(0)));
            Console.WriteLine(doc.FullName);
            MSK.MaskEngine mskObj = new MSK.MaskEngine();
            MSK.Mask mask1 = mskObj.Masks.Add();
            Console.WriteLine("Success");
            Console.ReadLine();
        }

 

This script works if the exe file run with MGLAUNCH.exe.

But  if it run in Visual Studio Debug mode I get error license is not available in this line "MSK.Mask mask1 = mskObj.Masks.Add();"

How can I use the Visual Studio debugger if the script use MaskEngine or other Engine that require Automation Pro license?

 

Thanks.

Eddy

Outcomes