Beckhoff / TF6000_ADS_DOTNET_V5_Samples

Sample code for the Version 6.X series of the TwinCAT ADS .NET Packages
https://infosys.beckhoff.com/content/1033/tc3_ads.net/9407515403.html?id=6770980177009971601
BSD Zero Clause License
37 stars 15 forks source link

Getting symbol value through ADS throws exception #46

Closed drvic10k closed 1 year ago

drvic10k commented 1 year ago

When I am getting the value using observables, I get this exception

I am using version 6.0.207, so the reference of TwinCAT.Ads 6.0.190 is strange

System.TypeLoadException HResult=0x80131522 Message=Method 'get_ErrorStrategy' in type 'TwinCAT.Ads.SumCommand.SumCommandWrapper1' from assembly 'TwinCAT.Ads, Version=6.0.190.0, Culture=neutral, PublicKeyToken=180016cd49e5e8c3' does not have an implementation. Source=TwinCAT.Ads StackTrace: at TwinCAT.Ads.Internal.DisposableHandleBag.OnCreateHandles() at TwinCAT.Ads.Internal.DisposableHandleBag1.CreateHandles() at TwinCAT.Ads.Internal.SymbolCache.init() at TwinCAT.Ads.AdsClient.d214.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at TwinCAT.Ads.AdsClient.d216.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

This exception was originally thrown at this call stack: TwinCAT.Ads.Internal.DisposableHandleBag.CreateHandles() TwinCAT.Ads.Internal.SymbolCache.init() TwinCAT.Ads.AdsClient.TwinCAT.Ads.IAdsSymbolCacheProvider.GetSymbolCacheAsync(System.Threading.CancellationToken) System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) TwinCAT.Ads.AdsClient.ReadSymbolAsync(string, System.Threading.CancellationToken) System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

RalfHeitmann commented 1 year ago

This seems to be the same issue on your local system as #44. The Package dependencies from Version 6.0.207 look ok. Duplicate.