Asked — Edited

My Skill No Longer Compiles - Getting Message That A Method Does Not Exist

I developed a private Beta skill about four months ago, and it was functioning perfectly. However, after a recent update to ARC, I'm unable to compile the skill code. I haven't made any changes to the code. The issue arises with the custom method GetRandomCharacters(), which is directly based on the example provided. This method includes a check for (Engine.CancelRequested), but it seems that the CancelRequested method is no longer defined. Could someone explain what has changed in ARC and what steps I need to take to resolve this issue?


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.

PRO
Canada
#1  

It sounds like there have been updates to the ARC platform that may have affected the availability or functionality of certain methods, such as Engine.CancelRequested. This can happen when the underlying API or framework is updated, and some methods are deprecated or replaced with new ones.

Here's how you can address this issue:

  1. Check the Release Notes:

    • Visit the Synthiam ARC Release Notes to see if there are any mentions of changes to the API or specific methods that might affect your skill.
  2. Review the Updated Documentation:

    • Check the Synthiam ARC API Documentation for any changes to the methods you are using. Look for any new methods that might replace Engine.CancelRequested.
  3. Update Your Code:

    • If Engine.CancelRequested has been deprecated or replaced, you will need to update your code to use the new method. Look for any alternative methods in the documentation that provide similar functionality.
  4. Test Your Skill:

    • After making the necessary changes, test your skill to ensure it compiles and functions as expected.
  5. Community and Support:

    • If you are still having trouble, consider reaching out to the Synthiam community or checking the forums for similar issues. Other developers might have encountered the same problem and could offer solutions.
  6. Example Code:

    • If you need help with specific code changes, feel free to share the relevant parts of your code, and I can assist you with updating it.

If you have any specific questions or need further assistance, feel free to ask!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
PRO
Synthiam
#2  
  1. make sure your reference points to the correct ezb.dll and arc.exe. That can change when your location of the source changed

  2. ensure you’re project is set for 4.8 .net

providing actual error messages is useful

#3  

The advice DJ gave is correct. However, providing any more suggestions without knowing the error messages is impossible. The error messages are formatted in text, providing exact reasoning behind compile issues. The words of the text are specific to the error and, therefore, would need to be shared. Without knowing the specifics, it's not possible to provide guidance.

To copy the text from the error, look in the Output window of Visual Studio. There, you will see text with the error. By selecting the text and copying it, you can paste it into the forum post. Just remember, any code you paste should be in code tags. If you do not properly format the text you paste, it will be impossible for anyone to read.

PRO
USA
#4   — Edited

The error I'm getting is:

1>C:\Users\jsale\Documents\ARC\Behavior Control Projects\Arm Interface\MY_PROJECT_NAME\MainForm.cs(143,28,143,43): error CS1061: 'Engine' does not contain a definition for 'CancelRequested' and no accessible extension method 'CancelRequested' accepting a first argument of type 'Engine' could be found (are you missing a using directive or an assembly reference?)

The code is:

        public string GetRandomCharacters(int count)
        {

            StringBuilder sb = new StringBuilder(count);

            var r = new Random();

            for (int x = 0; x < count; x++)
                if (Engine.CancelRequested)
                    return string.Empty;
                else
                    sb.Append(_CHARS[r.Next(_CHARS.Length)]);

            return sb.ToString();
        }

*Edited for formating so the code can be read and understood.

#5  

I'm sorry; that is not an error message. What you have provided is the code that is compiled with your program. The code you write instructs various methods and functions to do tasks in an order. An error message will be displayed in the Output or Errors window of Visual Studio. This window is only present when you compile source code. The Output window will display messages during the compile process. If there are errors, they will be displayed in the Output window.

#6  

I see that you have edited the post to include the error message. That is useful, thank you. I also edited your post to format the error message in the text to be readable.

The error states that CancelRequested for something called Engine does not exist. Can you please explain what type of object Engine is?

PRO
USA
#7  
#region Assembly ARC, Version=2015.8.9.0, Culture=neutral, PublicKeyToken=c3a3457c97d352d9
// C:\Program Files (x86)\Synthiam Inc\EZ-Builder\ARC.exe
#endregion

using EZ_B;
using Jint;

namespace ARC.Scripting.JavaScript
{
    public abstract class DynamicCommandTemplate : DisposableBase
    {
        public DynamicCommandTemplate(JavascriptEngine javascriptEngine, string javascriptObjectName, string friendlyDescription);

        public string JavaScriptObjectName { get; }
        public string FriendlyDescription { get; }
        public JavascriptEngine JavascriptEngine { get; }
        public Engine Engine { get; }

        public override string ToString();
    }
}

#8  

It isn't easy to understand from the snippet of code, but I believe the Engine is a Jint.Engine, which does not contain a CancelRequested. The object you would use to determine if a script has been canceled is JavaScriptEngine.CancelRequested

Ensure JavaScriptEngine is populated with javascriptEngine.

 public string GetRandomCharacters(int count)
        {

            StringBuilder sb = new StringBuilder(count);

            var r = new Random();

            for (int x = 0; x < count; x++)
                if (JavaScriptEngine.CancelRequested)
                    return string.Empty;
                else
                    sb.Append(_CHARS[r.Next(_CHARS.Length)]);

            return sb.ToString();
        }