You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using AutofacWebServiceHostFactory to create a service, when that service is not registered in the container, results in an unhelpful NRE, instead of throwing the intended InvalidOperationException (
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Autofac.Integration.Wcf
StackTrace:
at Autofac.Integration.Wcf.DefaultServiceImplementationDataProvider.GetServiceImplementationData(String value)
at Autofac.Integration.Wcf.AutofacHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
at BugRepro.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) in C:\Users\jdubbeldam\source\repos\BugRepro\BugRepro\ServiceHostFactory.cs:line 17
Describe the Bug
When using
AutofacWebServiceHostFactory
to create a service, when that service is not registered in the container, results in an unhelpful NRE, instead of throwing the intended InvalidOperationException (Autofac.Wcf/src/Autofac.Integration.Wcf/DefaultServiceImplementationDataProvider.cs
Line 85 in 1987b3e
Steps to Reproduce
See this minimal working example project: https://github.com/JarkoDubbeldam/Autofac.Integraction.Wcf.BugRepro/blob/master/BugRepro/ServiceHostFactory.cs
Expected Behavior
I'd expect a more helpful error :)
Exception with Stack Trace
Dependency Versions
Additional Info
It appears to me that this statement can never be true, due to
serviceRegistration
not being nullable.The text was updated successfully, but these errors were encountered: