azure-webjobs-sdk: Web job not starting after configuring App Insights logging
I’m trying to configure app insights for my queue triggered web job in the way it is described here and getting the following error on web job statup:
Newtonsoft.Json.JsonException occurred
HResult=0x80131500
Message=Error creating ‘Microsoft.Azure.WebJobs.Host.Protocols.PersistentQueueMessage+PersistentQueueMessageConverter’.
Source=Newtonsoft.Json
StackTrace:
at Newtonsoft.Json.Serialization.JsonTypeReflector.<>c__DisplayClass21_0.<GetCreator>b__0(Object[] parameters)
at Newtonsoft.Json.Serialization.JsonTypeReflector.GetJsonConverter(Object attributeProvider)
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContractConverter(Type objectType)
at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract(JsonContract contract)
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType)
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)
at Newtonsoft.Json.JsonConvert.SerializeObject(Object value, JsonSerializerSettings settings)
at Microsoft.Azure.WebJobs.Host.Protocols.PersistentQueueWriter1.<EnqueueAsync>d__3.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Microsoft.Azure.WebJobs.Host.Executors.JobHostConfigurationExtensions.<CreateJobHostContextAsync>d__1.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult()
at Microsoft.Azure.WebJobs.JobHost.<RuntimeInitAsync>d__44.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Microsoft.Azure.WebJobs.JobHost.<StartAsyncCore>d__25.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Microsoft.Azure.WebJobs.JobHost.Start()
at Microsoft.Azure.WebJobs.JobHost.RunAndBlock()
at [My code here]
Inner Exception 1: ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 1
- Comments: 16 (7 by maintainers)
I just hit the same failure after trying to enable AppInsight on my WebJob. Here is the content of packages.config (Newtonsoft.Json v10.0.3 too).
I had this exact same problem, Turned out I was referencing Newtonsoft.Json v10.0.0.3 in a dependent project. I downgraded to Newtonsoft.Json v9.0.1 in all projects and everything started working.