georgep...@hotmail.com
unread,Mar 19, 2015, 1:27:11 PM3/19/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to aut...@googlegroups.com
My WebApiConfig looks like this:
Public Module WebApiConfig
Public Sub Register()
Dim options As ConfigOptions = New ConfigOptions()
Dim config As HttpConfiguration = ServiceConfig.Initialize(New ConfigBuilder(options, Function(configuration, builder)
builder.RegisterType(Of BarMOSDbContext).As(Of IDbContext)() builder.RegisterGeneric(GetType(Repository(Of ))).[As](GetType(IRepository(Of )))
builder.RegisterType(Of DeviceDomainManager).As(Of IDeviceDomainManager)()
Return True
End Function))
End Sub
End Module
Locally everything is ok but when I publish to Azure I get an Invalid operation exception
Error Exception=System.InvalidOperationException: An error occurred when trying to create a controller of type 'DeviceController'. Make sure that the controller has a parameterless public constructor. ---> Autofac.Core.DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'BarMOS.Service.DeviceController' can be invoked with the available services and parameters:
Cannot resolve parameter 'BarMOS.Service.DomainManagers.Abstract.IDeviceDomainManager deviceManager' of constructor 'Void .ctor(BarMOS.Service.DomainManagers.Abstract.IDeviceDomainManager)'.
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType)
at
Why locally everything is OK and when I upload I get this error? Can anyone help me?
Thank you for your time.