intuit / intuit/QuickBooks-V3-DotNET-SDK
Serilog Method not found blocking issue
- Dominant language
- C#
- Stars
- 121
- Forks
- 145
- Avg merge
- 17h 1m
- Merged PRs (30d)
- 1
Description
Using the latest IPP version (14.6.3), whenever attempting to pass the ServiceContext as an argument, the following error message is returned;
`"Method not found: 'Serilog.LoggerConfiguration Serilog.FileLoggerConfigurationExtensions.File(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider, System.Nullable1, Serilog.Core.LoggingLevelSwitch, Boolean, Boolean, System.Nullable1, Serilog.RollingInterval, Boolean, System.Nullable1, System.Text.Encoding, Serilog.Sinks.File.FileLifecycleHooks)'."`
I've seen multiple answers relating to the ServiceContext saying to downgrade Serilog.Sinks.Debug to an outdated version but my project does not use Serilog. I'll attach the entire function that is failing.
```
OAuth2RequestValidator ouathValidator = new OAuth2RequestValidator(
"ACCESS_TOKEN");
ServiceContext serviceContext = new ServiceContext(
"AUTH_CODE",
IntuitServicesType.QBO, ouathValidator);
Invoice invoice = new();
invoice.Deposit = new Decimal(0.00);
invoice.DepositSpecified = true;
List lineList = new List();
Line line = new Line();
line.Description = "Description";
line.Amount = new Decimal(100.00);
line.AmountSpecified = true;
lineList.Add(line);
invoice.Line = lineList.ToArray();
SalesItemLineDetail salesItemLineDeatil = new SalesItemLineDetail();
salesItemLineDeatil.Qty = new Decimal(1.0);
line.AnyIntuitObject = salesItemLineDeatil;
line.DetailType = LineDetailTypeEnum.SalesItemLineDetail;
line.DetailTypeSpecified = true;
invoice.DueDate = DateTime.UtcNow.Date;
invoice.DueDateSpecified = true;
invoice.TotalAmt = new Decimal(10.00);
invoice.TotalAmtSpecified = true;
invoice.EmailStatus = EmailStatusEnum.NotSet;
invoice.EmailStatusSpecified = true;
invoice.Balance = new Decimal(10.00);
invoice.BalanceSpecified = true;
invoice.TxnDate = DateTime.UtcNow.Date;
invoice.TxnDateSpecified = true;
invoice.TxnTaxDetail = new TxnTaxDetail()
{
TotalTax = Convert.ToDecimal(10),
TotalTaxSpecified = true
};
QueryService querySvcItem = new QueryService(serviceContext);
Item item = querySvcItem.ExecuteIdsQuery(
"SELECT * FROM Item WHERE Name = 'Lighting'").FirstOrDefault();
salesItemLineDeatil.ItemRef = new ReferenceType
{
Value = item.Id
};
QueryService querySvc = new QueryService(serviceContext);
Customer customer = querySvc.ExecuteIdsQuery
("SELECT * FROM Customer WHERE CompanyName like 'Clement%'").
FirstOrDefault();
invoice.CustomerRef = new ReferenceType()
{
Value = customer.Id
};
DataService service = new DataService(serviceContext);
Invoice addedInvoice = service.Add(invoice);
```
Having tried multiple times to debug and re-arrange code to get to the bottom of the issue, it appears anytime the serviceContext is passed in as an argument to either the `QueryService` or `DataService`
Additional note that none of this code is my own, this is all taken from an example found in the docs so I'm confident in ruling out anything on my end and that the issue is in the IppDotNetSdkForQuickBooksApiV3 itself.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the documented sample with IPP version 14.6.3, focusing on ServiceContext passed to QueryService and DataService. Inspect the resolved Serilog-related dependencies against the missing File method signature. Done means the sample can construct and use these services without the method-not-found error, with the compatible dependency change identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100