box / box-windows-sdk-v2

Windows SDK for v2 of the Box API. The SDK is built upon .NET Framework 4.5

Home Page:https://developer.box.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Box API Object reference not set to an instance of an object. When AdminToken()

xubair81 opened this issue · comments

`try
{
using (FileStream fs = new FileStream(@"C:\Cube\Document\BoxSetup\BoxSetting.json", FileMode.Open))
{
boxJWT = new BoxJWTAuth(BoxConfig.CreateFromJsonFile(fs));

    var adminToken = boxJWT.AdminToken();//**here i am getting null reference exception**
    var adminClient = boxJWT.AdminClient(adminToken);
    adminClientGlobal = adminClient;
    BoxManager = new BoxManager(adminToken);
    return true;
}

}
catch (Exception ex)
{
SendEmail(ex.Message);
throw ex;
}
`
Note: same json file work with other application without issue so ther is no access issue

Thanks for submitting this Issue.  Unfortunately, it is missing the required checkbox fields that were provided in the template when you initially created the Issue:

Please perform each step above to research your Issue before submitting it to our team. If you are still unable to resolve it, please re-create this Issue and check off those boxes when you submit it!  Thanks for helping to streamline our process!