Application works as it should be on Debug mode.
On Release mode I am getting exception saying
Exception thrown: 'Autofac.Core.Registration.ComponentNotRegisteredException' in Autofac.dll
Additional information: The requested service 'Microsoft.Extensions.Options.IOptions`1[[TIKSN.GroceryChecklist.Models.Configuration.HockeyAppConfiguration, Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
This is the line that throws exception
var hockeyAppOptions = serviceProvider.GetRequiredService<IOptions<HockeyAppConfiguration>>();
But this option is configured and works fine in Debug mode.
services.Configure<HockeyAppConfiguration>(option =>
{
option.AppID = "my key";
});
I also tried to add type registration line in Default.rd.xml file but it did not work neither.
<Type Name="Microsoft.Extensions.Options.IOptions{TIKSN.GroceryChecklist.Models.Configuration.HockeyAppConfiguration}" Dynamic="Required Public" />