Object reference not set to an instance of an object.

Hi everybody,
i'm facing the following error while publishing an app in VS Code:
The request for path /***/dev/apps?SchemaUpdateMode=forcesync&DependencyPublishingOption=default failed with code UnprocessableEntity. Reason: Object reference not set to an instance of an object.

The error comes up when i use Enum variable, for example:
EnumVar := EnumVar::Value1;

Do you have any suggestion?

Thanks

Answers

  • PhoguePhogue Member Posts: 76
    Have you downloaded symbols?
    Is this from a dependency?
  • internship01internship01 Member Posts: 6
    Yes to both.
  • PhoguePhogue Member Posts: 76
    I would check if all the dependencies are installed properly - I had this exact issue last week

    My "name" variable under dependencies in app.json was not equal to the installed extension.
    I had to re-install the proper extension, and then download symbols again
  • tonygruztonygruz Member Posts: 1
    In a nutshell it means.. You are trying to access an object without instantiating it.. You might need to use the "new" keyword to instantiate it first i.e create an instance of it. An Object is an instance of a Class , it is stored some where in memory. A reference is what is used to describe the pointer to the memory location where the Object resides. The message "object reference not set to an instance of an object" means that you are referring to an object the does not exist or was deleted or cleaned up. It's usually better to avoid a NullReferenceException than to handle it after it occurs. To prevent the error, objects that could be null should be tested for null before being used.

    if (mClass != null)
    {
    // Go ahead and use mClass
    mClass.property = ...
    }
    else
    {
    // Attempting to use mClass here will result in NullReferenceException
    }

  • DenSterDenSter Member Posts: 8,304
    Try MyEnumVar := Enum::EnumType::EnumValue;
  • internship01internship01 Member Posts: 6
    Thanks for the answers, at the the end the problem was due to an Enum extentesion, maybe a problem of BC14.
  • DenSterDenSter Member Posts: 8,304
    What was the problem? You have an enum extension that wasn't recognized or something?
  • internship01internship01 Member Posts: 6
    It gave me the error in the question when I tried to publish, if I use the extended enum:
    EnumVar := EnumVar::Value1;

    Probably it was a bug of BC14.
Sign In or Register to comment.