intuit / QuickBooks-V3-DotNET-SDK

.Net SDK for QuickBooks REST API v3 services
Apache License 2.0
107 stars 140 forks source link

This prerelease did not fix Serilog issue for me #214

Closed redhorseck closed 2 years ago

redhorseck commented 2 years ago

An issue was reported last year with Serilog dependencies. I also had the same issue and I commented on it here: https://github.com/intuit/QuickBooks-V3-DotNET-SDK/issues/198

It was suggested to update to this prerelease version to fix the issue. I updated IppDotNetSdkForQuickBooksApiV3 to 14.6.2-Pre I updated all Serilog dependencies to the latest stable, including these: Serilog.Sinks.Console - 4.0.1 Serilog.Sinks.File - 5.0.0 Serilog.Sinks.Trace - 3.0.0

I still get an error on this line: Dim tokenClient As New TokenClient(myTokenEndpoint, myClientID, myClientSecret)

The error is the same as 14.6.1 Method not found: 'Serilog.LoggerConfiguration Serilog.FileLoggerConfigurationExtensions.File(Serilog.Configuration.LoggerSinkConfiguration, System.String, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider, System.Nullable1<Int64>, Serilog.Core.LoggingLevelSwitch, Boolean, Boolean, System.Nullable1, Serilog.RollingInterval, Boolean, System.Nullable`1, System.Text.Encoding, Serilog.Sinks.File.FileLifecycleHooks)'.

redhorseck commented 2 years ago

Downgrading the Serilog dlls forces the IppDotNetSdkForQuickBooksApiV3 to downgrade to version 8. This is not ideal. I think the answer will be to download the sdk and rebuild it with the higher level Serilog dlls. I don't know how to do this. I downloaded it and updated the version number on any references to these Serilog dlls and rebuilt the project. It did not produce anything called IppDotNetSdkForQuickBooksApiV3.dll. So I don't know what I'm doing or how to do it. Can anyone provide instruction as to whether this will work and if so how to do it? I am using .net 4.7.2. Thanks!

ewm commented 2 years ago

I'm also having an issue with the Serilog dependency. We downgraded our Sink.Console version so our integration would still work, but hopefully you can upgrade to >=4.0.1?

Error: Method not found: 'Serilog.LoggerConfiguration Serilog.ConsoleLoggerConfigurationExtensions.Console(Serilog.Configuration.LoggerSinkConfiguration, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider, Serilog.Core.LoggingLevelSwitch, System.Nullable`1<Serilog.Events.LogEventLevel>, Serilog.Sinks.SystemConsole.Themes.ConsoleTheme)'. at Intuit.Ipp.Core.Rest.AdvancedLogging..ctor(Boolean enableSerilogRequestResponseLoggingForDebug, Boolean enableSerilogRequestResponseLoggingForTrace, Boolean enableSerilogRequestResponseLoggingForConsole, Boolean enableSerilogRequestResponseLoggingForFile, String serviceRequestLoggingLocationForFile) at Intuit.Ipp.Core.CoreHelper.GetAdvancedLogging(ServiceContext serviceContext) at Intuit.Ipp.Core.Rest.RestHandler.PrepareRequest(RequestParameters requestParameters, Object requestBody, String oauthRequestUri, Boolean includeRequestId) at Intuit.Ipp.Core.Rest.SyncRestHandler.PrepareRequest(RequestParameters requestParameters, Object requestBody, String oauthRequestUri, Boolean includeRequestId) at Intuit.Ipp.DataService.DataService.FindAll[T](T entity, Int32 startPosition, Int32 maxResults)

redhorseck commented 2 years ago

I updated to ipp 14.6.3 to see if it would help. It did not. I get the same error with current serilog files. I downgraded just Sink.Console as you suggested worked for you @ewm but I still get the same error, although it does keep ipp v 14.6.3 without downgrading. The only way to get it to work is to downgrade Sinks.File and that causes the downgrade of ipp to v8. Isn't there a way around this? I don't know how to take the code and build a version that will work. Does anyone have a suggestion? I've been hoping for some pointers for weeks and I'm stuck not knowing what to do.

ewm commented 2 years ago

@redhorseck not my favorite idea but we might fork Serilog.Sinks.Console and lock in our own version. We haven't decided what to do long term yet. Our integration looks to be on 14.6.1 btw.

redhorseck commented 2 years ago

I finally got this working. I downgraded Sinks.File to 4.1.0 and Sinks.Console to 3.1.1. It did not trigger a downgrade of ipp so we are still on 14.6.3. It does mean that every time there is an upgrade to ipp, I will have to go back in to downgrade these two. I'd think there would be a way to tell nuget to install the ones that works and not the latest. At least it works now!

JimHume commented 2 years ago

@redhorseck Your workaround solved my exact issue (thank you).

Regarding those specific version numbers: were those from the "Dependencies" description of the nuget package? I want to be sure what to keep an eye out for should I ever need to upgrade the SDK.

redhorseck commented 2 years ago

I'm not sure what you mean by specific version numbers. The dependencies description says > x. But I don't know that that defines what works and what doesn't. For me it was identified in another post and I used their recommendation.

MaximillianC commented 1 year ago

@redhorseck I see you closed this as completed, but did @nimisha84 ever actually fix the bug where the latest versions of Intuit.Ipp aren't actually compatible with Serilog.Sinks.Console 4.0? We've been holding off on upgrading Serilog.Sinks.Console since before September 2021 due to this issue, so I'd really like to know if we're safe to use the latest Serilog packages now.

redhorseck commented 1 year ago

This issue was never fixed. We are forced to continue to use the version of the api v8.1.0 from 8/28/2019 whereas the current version is 14.6.3.4. How is this even possible or necessary? I wish there was a fix for this. When you update to the current version it updates serilog which causes errors. When you downgrade serilog it downgrades ippdotnet to v 8.1.

webs1331 commented 1 year ago

I second this - trying to get started with this SDK has been a rough venture. Running into the same issues as you.

clement911 commented 1 year ago

Consider using https://github.com/better-reports/QuickBooksSharp as a simple, async-first, modern alternative. FYI This is a community package that I maintain and I accept contributions.