Get 50% OFF QuickBooks for 3 months*

Buy now
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Simplify payday and set payroll to run automatically on QuickBooks.Explore QuickBooks Payroll
Naveen Baghel
Level 1

System.NullReferenceException: 'Object reference not set to an instance of an object.'

OAuth2RequestValidator oauthValidator = new OAuth2RequestValidator(principal.FindFirst("access_token").Value);

 

showing error:- System.NullReferenceException: 'Object reference not set to an instance of an object.'

3 Comments 3
SirielJeaB
Moderator

System.NullReferenceException: 'Object reference not set to an instance of an object.'

It's our pleasure that you've posted here in our Community forum, Naveen. Thanks for reaching out to us.


Our top priority is to help you resolve your problem. But I need more details about it. Would you mind sharing what QuickBooks Online activity you were processing at the time this error message appeared? Any additional information you can provide to help us choose and give you the best resolution would be greatly appreciated.


I'm looking forward to helping you in the future. Have a nice day!

Naveen Baghel
Level 1

System.NullReferenceException: 'Object reference not set to an instance of an object.'

public ServiceContext IntializeContext(string realmId)
{
var principal = User as ClaimsPrincipal;
OAuth2RequestValidator oauthValidator = new OAuth2RequestValidator(principal.FindFirst("access_token").Value);
ServiceContext serviceContext = new ServiceContext(realmId, IntuitServicesType.QBO, oauthValidator);
//Enable minorversion
serviceContext.IppConfiguration.MinorVersion.Qbo = "23";
//Enable logging
//serviceContext.IppConfiguration.Logger.RequestLog.EnableRequestResponseLogging = true;
//serviceContext.IppConfiguration.Logger.RequestLog.ServiceRequestLoggingLocation = @"C:\IdsLogs";//Create a folder in your drive first
return serviceContext;
}

 

 

Rasa-LilaM
QuickBooks Team

System.NullReferenceException: 'Object reference not set to an instance of an object.'

Thank you for turning to the Community about your concern, Naveen Baghel.

 

I want to ensure I can provide an accurate solution to your concern. To get me on the same page, I have to ask for more details.

 

May I know if you're trying to integrate an application with  QuickBooks Online (QBO)? What specific task did you perform? Which area in your company did you encounter the error?

 

While waiting for your response, let me share the link to the Community page. From there, you'll gain access to our tools and resources to help you run and grow your business. Simply choose the topic from the list that suits your concern. 

 

I appreciate any information you can share. I'm looking forward to working with you again, Baghel.

Need QuickBooks guidance?
Log in to access expert advice and community support instantly.

Need to get in touch?

Contact us