Search code examples
.netautodesk-forgeautodesk-data-managementdotnet-sdk.net-sdk

Autodesk Platform Services (Forge) .NET SDK OssClient.DeleteObjectAsync() & OssClient.GetObjectDetailsAsync() NullReferenceException


I can successfully create a new object in the specified bucket using a local file as shown. This can be verified using the OSS Manager Tool

Screenshot.

But, I'm unable to get the details for that object or to delete that object. The call is being thrown with a 'System.NullReferenceException' without any details. Access token & bucket key are the same as shown in the upload image, so those are not null.

Screenshot

All scopes were added to the token to ensure that wasn't the issue, even though it would have thrown a different error for that.

Screenshot

What is the proper way to successfully execute these methods?

I've tried using the name of the object, the objectId & the objectKey without success.


Solution

  • Are you using their latest Nuget package (1.1.0) ? If yes, try downgrading to an earlier version.

    I was running into the same issue earlier today, and this resolved it. I think they forgot to initialize their objectsApi field in the constructor of their OssClient in their latest relase of the SDK package.

    Best