Singleton dependency not resolved in web host startup

0

The solution was recently upgraded from ASP.NET Core 2.0 -> 2.1. Upon running the new solution, the following code begets the following error:

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IApplicationLifetime appLifetime, TextingActivityListener textingActivityListener)

System.Exception
  HResult=0x80131500
  Message=Could not resolve a service of type 'CustomerExperience.Internal.Texting.TextingActivityListener' for the parameter 'textingActivityListener' of method 'Configure' on type 'CustomerExperience.Internal.Web.Startup'.
  Source=Microsoft.AspNetCore.Hosting
  StackTrace:
   at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.<StartAsync>d__26.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.<RunAsync>d__5.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.<RunAsync>d__4.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
   at CustomerExperience.Internal.Web.Program.Main(String[] args) in C:\src\customer-experience\CustomerExperience.Internal.Web\Program.cs:line 18

Inner Exception 1:
MissingMethodException: Method not found: 'Void Newtonsoft.Json.JsonSerializer.set_TypeNameAssemblyFormat(System.Runtime.Serialization.Formatters.FormatterAssemblyStyle)'.

The TextingActivityListener is defined in another project in the same solution which is being compiled as a .NET Core 2.1 class library. It does not have a Newtonsoft.Json dependency.

c#
asp.net-core-2.1
asked on Stack Overflow Dec 21, 2018 by Ethan Williams

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0