Microsoft.Azure.Devices.Client package (v1.4.2)Since the package installs, I would expect the project to build and run (without actually calling into the new NuGet package code).
Build exception
Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Newtonsoft.Json.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)
If I manually install the missing NuGet package to get the reference needed, it continues to change the error message for other missing assemblies, in this order:
Microsoft.Azure.Devices.Shared, Version=1.0.0.0Microsoft.WindowsAzure.Storage, Version=8.1.1.0DotNetty.Transport, Version=0.4.6.0 (plus a conflict between "different versions of the same dependent assembly")DotNetty.Codecs.Mqtt, Version=0.4.6.0DotNetty.Handlers, Version=0.4.6.0I haven't tested if any code using Microsoft.Azure.Devices.Shared actually works yet. This was all just to get the project to build.
In case it helps to debug things, here's what NuGet says while installing the initial Microsoft.Azure.Devices.Client package on the Xamarin.Android project.
Attempting to gather dependency information for package 'Microsoft.Azure.Devices.Client.1.4.2' with respect to project 'App11', targeting 'MonoAndroid,Version=v7.1'
Gathering dependency information took 7.85 sec
Attempting to resolve dependencies for package 'Microsoft.Azure.Devices.Client.1.4.2' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.Azure.Devices.Client.1.4.2'
Resolved actions to install package 'Microsoft.Azure.Devices.Client.1.4.2'
Retrieving package 'Microsoft.Azure.Amqp 2.0.4' from 'nuget.org'.
Retrieving package 'Microsoft.Azure.Devices.Client 1.4.2' from 'nuget.org'.
Retrieving package 'PCLCrypto 2.0.147' from 'nuget.org'.
Retrieving package 'PInvoke.BCrypt 0.3.2' from 'nuget.org'.
Retrieving package 'PInvoke.Kernel32 0.3.2' from 'nuget.org'.
Retrieving package 'PInvoke.NCrypt 0.3.2' from 'nuget.org'.
Retrieving package 'PInvoke.Windows.Core 0.3.2' from 'nuget.org'.
Retrieving package 'Validation 2.2.8' from 'nuget.org'.
Adding package 'Microsoft.Azure.Amqp.2.0.4' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'Microsoft.Azure.Amqp.2.0.4' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'Microsoft.Azure.Amqp.2.0.4' to 'packages.config'
Successfully installed 'Microsoft.Azure.Amqp 2.0.4' to App11
Adding package 'PInvoke.Windows.Core.0.3.2' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'PInvoke.Windows.Core.0.3.2' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'PInvoke.Windows.Core.0.3.2' to 'packages.config'
Successfully installed 'PInvoke.Windows.Core 0.3.2' to App11
Adding package 'PInvoke.Kernel32.0.3.2' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'PInvoke.Kernel32.0.3.2' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'PInvoke.Kernel32.0.3.2' to 'packages.config'
Successfully installed 'PInvoke.Kernel32 0.3.2' to App11
Adding package 'PInvoke.BCrypt.0.3.2' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'PInvoke.BCrypt.0.3.2' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'PInvoke.BCrypt.0.3.2' to 'packages.config'
Successfully installed 'PInvoke.BCrypt 0.3.2' to App11
Adding package 'PInvoke.NCrypt.0.3.2' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'PInvoke.NCrypt.0.3.2' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'PInvoke.NCrypt.0.3.2' to 'packages.config'
Successfully installed 'PInvoke.NCrypt 0.3.2' to App11
Adding package 'Validation.2.2.8' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'Validation.2.2.8' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'Validation.2.2.8' to 'packages.config'
Successfully installed 'Validation 2.2.8' to App11
Adding package 'PCLCrypto.2.0.147' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'PCLCrypto.2.0.147' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'PCLCrypto.2.0.147' to 'packages.config'
Successfully installed 'PCLCrypto 2.0.147' to App11
Adding package 'Microsoft.Azure.Devices.Client.1.4.2' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'Microsoft.Azure.Devices.Client.1.4.2' to folder 'c:\Users\someuser\documents\visual studio 2017\Projects\App11\packages'
Added package 'Microsoft.Azure.Devices.Client.1.4.2' to 'packages.config'
Successfully installed 'Microsoft.Azure.Devices.Client 1.4.2' to App11
Executing nuget actions took 7.46 sec
Time Elapsed: 00:00:15.3466369
========== Finished ==========
Microsoft Visual Studio Enterprise 2017
Version 15.3.3
VisualStudio.15.Release/15.3.3+26730.12
Microsoft .NET Framework
Version 4.7.02046
Installed Version: Enterprise
Architecture Diagrams and Analysis Tools 00369-60000-00001-AA352
Microsoft Architecture Diagrams and Analysis Tools
Visual Basic 2017 00369-60000-00001-AA352
Microsoft Visual Basic 2017
Visual C# 2017 00369-60000-00001-AA352
Microsoft Visual C# 2017
Visual C++ 2017 00369-60000-00001-AA352
Microsoft Visual C++ 2017
Visual F# 4.1 00369-60000-00001-AA352
Microsoft Visual F# 4.1
Application Insights Tools for Visual Studio Package 8.8.00712.1
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2017 15.0.30726.0
ASP.NET and Web Tools 2017
ASP.NET Core Razor Language Services 1.0
Provides languages services for ASP.NET Core Razor.
ASP.NET Template Engine 2017 15.0.30726.0
ASP.NET Template Engine 2017
ASP.NET Web Frameworks and Tools 2017 5.2.50601.0
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 15.0.30728.0
Azure App Service Tools v3.0.0
Azure Data Lake Node 1.0
This package contains the Data Lake integration nodes for Server Explorer.
Azure Data Lake Tools for Visual Studio 2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio
Azure Data Lake Tools for Visual Studio 2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Fabric.ApplicationInsights 1.0
Allows user to instrument their Service Fabric projects for Application Insights.
Fabric.DiagnosticEvents 1.0
Fabric Diagnostic Events
JavaScript Language Service 2.0
JavaScript Language Service
JavaScript Project System 2.0
JavaScript Project System
JavaScript UWP Project System 2.0
JavaScript UWP Project System
Merq 1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.
Microsoft Azure HDInsight Azure Node 2.2.9000.1
HDInsight Node under Azure Node
Microsoft Azure Hive Query Language Service 2.2.9000.1
Language service for Hive query
Microsoft Azure Service Fabric Tools for Visual Studio 1.7
Microsoft Azure Service Fabric Tools for Visual Studio
Microsoft Azure Stream Analytics Language Service 2.2.9000.1
Language service for Azure Stream Analytics
Microsoft Azure Stream Analytics Node 1.0
Azure Stream Analytics Node under Azure Node
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50719.1
Microsoft Continuous Delivery Tools for Visual Studio 0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards
Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package
Mono Debugging for Visual Studio 4.6.8-pre (ec7034f)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 4.3.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
SQL Server Data Tools 15.1.61707.200
Microsoft SQL Server Data Tools
ToolWindowHostedEditor 1.0
Hosting json editor into a tool window
TypeScript 2.3.4.0
TypeScript tools for Visual Studio
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for Universal Windows Apps 15.0.26730.08
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.
WebJobs Tools v1.0.0 15.0.30901.0
WebJobs Tools v1.0.0
Xamarin 4.6.0.299 (b63523e27)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android SDK 7.4.0.21 (2851083)
Xamarin.Android Reference Assemblies and MSBuild support.
Xamarin.iOS and Xamarin.Mac SDK 10.12.0.20 (80b8487)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
@patridge We are aware of the issue and are investigating the root cause. From my testing it only happens on Xamarin Android and Xamarin.iOS, currently what you did is the current work around. As of now we don't have an ETA for a fix.
Hi,
after installing the missing packages I got a runtime exception with the Android version of a xamarin forms project . With the uwp version of the project all is ok.
I am trying to send a message to my Iot hub.
StackTrace:
at Microsoft.Azure.Devices.Client.MessageConverter.TryGetAmqpObjectFromNetObject (System.Object netObject, Microsoft.Azure.Devices.Client.MappingType mappingType, System.Object& amqpObject) [0x00008] in <682ea61dd76b434382060d1847434f7e>:0
at Microsoft.Azure.Devices.Client.MessageConverter.UpdateAmqpMessageHeadersAndProperties (Microsoft.Azure.Amqp.AmqpMessage amqpMessage, Microsoft.Azure.Devices.Client.Message data, System.Boolean copyUserProperties) [0x001d8] in <682ea61dd76b434382060d1847434f7e>:0
at Microsoft.Azure.Devices.Client.Message.PopulateAmqpMessageForSend (Microsoft.Azure.Amqp.AmqpMessage message) [0x00000] in <682ea61dd76b434382060d1847434f7e>:0
at Microsoft.Azure.Devices.Client.Message.ToAmqpMessage (System.Boolean setBodyCalled) [0x0005e] in <682ea61dd76b434382060d1847434f7e>:0
at Microsoft.Azure.Devices.Client.Transport.AmqpTransportHandler+<>c__DisplayClass37_0+<
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.AmqpTransportHandler+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler+<>c__DisplayClass19_0+<
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler+<ExecuteWithErrorHandlingAsync>d__201[T].MoveNext () [0x0011f] in <682ea61dd76b434382060d1847434f7e>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.GateKeeperDelegatingHandler+
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Client.DeviceClient+<>c__DisplayClass64_0.
at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke () [0x00024] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Threading.Tasks.Task.Execute () [0x00010] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at IotDevice.ViewModels.DeviceDetailViewModel+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at IotDevice.ViewModels.DeviceDetailViewModel+<
We're tracking multiple issues caused by the PCL libraries. The decision was to remove the PCL binary from our next release.
As a workaround, please try adding a new netstandard1.3 (or 2.0) library to your project and reference it from the Xamarin application. Using our SDK within this library should make things work.
Tentatively closing this as a duplicate of #138 .
In my case it only worked if the netstandard library was 1.2 or lower otherwise I'd get the above exception or the Linker one
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10;</PackageTargetFallback>
</PropertyGroup>
Thanks for letting us know @PureWeen. I'll reopen this to ensure we don't hit that kind of issue after removing the PCL libs.
I think this is a duplicate of both #205 and #197.
Closing as dup of #205 which is fixed in 1.6.1 release.
Most helpful comment
Hi,
after installing the missing packages I got a runtime exception with the Android version of a xamarin forms project . With the uwp version of the project all is ok.
I am trying to send a message to my Iot hub.
The exception is:
The type initializer for 'Microsoft.Azure.Devices.Client.SerializationUtilities' threw an exception.
Inner exception is a TypeLoadException:
Could not resolve type with token 01000050 (from typeref, class/assembly System.ICloneable, Microsoft.Azure.Amqp, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
StackTrace:b__0>d.MoveNext () [0x0000a] in <682ea61dd76b434382060d1847434f7e>:0d__37.MoveNext () [0x0009c] in <682ea61dd76b434382060d1847434f7e>:0b__0>d.MoveNext () [0x00065] in <682ea61dd76b434382060d1847434f7e>:0d__20`1[T].MoveNext () [0x00321] in <682ea61dd76b434382060d1847434f7e>:0d__28.MoveNext () [0x00079] in <682ea61dd76b434382060d1847434f7e>:0d__25.MoveNext () [0x000cb] in <682ea61dd76b434382060d1847434f7e>:0d__9.MoveNext () [0x000c2] in <682ea61dd76b434382060d1847434f7e>:0d__16.MoveNext () [0x000e2] in <682ea61dd76b434382060d1847434f7e>:0b__2 (System.Threading.Tasks.Task t) [0x0001e] in <682ea61dd76b434382060d1847434f7e>:0d__21.MoveNext () [0x000b3] in J:\VisualStudioProjects\Xamarin\IotTest\IotDevice\IotDevice\ViewModels\DeviceDetailViewModel.cs:143b__18_0>d.MoveNext () [0x0009a] in J:\VisualStudioProjects\Xamarin\IotTest\IotDevice\IotDevice\ViewModels\DeviceDetailViewModel.cs:89
at Microsoft.Azure.Devices.Client.MessageConverter.TryGetAmqpObjectFromNetObject (System.Object netObject, Microsoft.Azure.Devices.Client.MappingType mappingType, System.Object& amqpObject) [0x00008] in <682ea61dd76b434382060d1847434f7e>:0
at Microsoft.Azure.Devices.Client.MessageConverter.UpdateAmqpMessageHeadersAndProperties (Microsoft.Azure.Amqp.AmqpMessage amqpMessage, Microsoft.Azure.Devices.Client.Message data, System.Boolean copyUserProperties) [0x001d8] in <682ea61dd76b434382060d1847434f7e>:0
at Microsoft.Azure.Devices.Client.Message.PopulateAmqpMessageForSend (Microsoft.Azure.Amqp.AmqpMessage message) [0x00000] in <682ea61dd76b434382060d1847434f7e>:0
at Microsoft.Azure.Devices.Client.Message.ToAmqpMessage (System.Boolean setBodyCalled) [0x0005e] in <682ea61dd76b434382060d1847434f7e>:0
at Microsoft.Azure.Devices.Client.Transport.AmqpTransportHandler+<>c__DisplayClass37_0+<
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.AmqpTransportHandler+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler+<>c__DisplayClass19_0+<
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter
1[TResult].GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler+<ExecuteWithErrorHandlingAsync>d__201[T].MoveNext () [0x0011f] in <682ea61dd76b434382060d1847434f7e>:0--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at Microsoft.Azure.Devices.Client.Transport.GateKeeperDelegatingHandler+
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Client.DeviceClient+<>c__DisplayClass64_0.
at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke () [0x00024] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Threading.Tasks.Task.Execute () [0x00010] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at IotDevice.ViewModels.DeviceDetailViewModel+
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0
at IotDevice.ViewModels.DeviceDetailViewModel+<