Ninject.Web.WebApi
Ninject.Web.WebApi copied to clipboard
Error in ModelValidatorProvider
When i used NuGet to upgrade the following message did appear when using Web API 2.1 and MVC5
Error activating ModelValidatorProvider using binding from ModelValidatorProvider to NinjectDefaultModelValidatorProvider A cyclical dependency was detected between the constructors of two services.
Activation path: 3) Injection of dependency ModelValidatorProvider into parameter defaultModelValidatorProviders of constructor of type DefaultModelValidatorProviders 2) Injection of dependency DefaultModelValidatorProviders into parameter defaultModelValidatorProviders of constructor of type NinjectDefaultModelValidatorProvider
- Request for ModelValidatorProvider
I had the same problem when I upgraded my packages with NuGet yesterday.
I resolved the issue by replacing the dll libaries manual with a version that worked. I Included a link for a version that works for me https://mega.co.nz/#!McBkDSYR!KTrY9rIOEMt0Ny_1xQqRTgPjrCvINg2sirjYjh8wOd0
I am also having this issue when I did a fresh install this morning:
Server Error in '/' Application.
Error activating ModelValidatorProvider using binding from ModelValidatorProvider to NinjectDefaultModelValidatorProvider A cyclical dependency was detected between the constructors of two services.
Activation path: 3) Injection of dependency ModelValidatorProvider into parameter defaultModelValidatorProviders of constructor of type DefaultModelValidatorProviders 2) Injection of dependency DefaultModelValidatorProviders into parameter defaultModelValidatorProviders of constructor of type NinjectDefaultModelValidatorProvider
- Request for ModelValidatorProvider
Suggestions:
- Ensure that you have not declared a dependency for ModelValidatorProvider on any implementations of the service.
- Consider combining the services into a single one to remove the cycle.
- Use property injection instead of constructor injection, and implement IInitializable if you need initialization logic to be run after property values have been injected.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Ninject.ActivationException: Error activating ModelValidatorProvider using binding from ModelValidatorProvider to NinjectDefaultModelValidatorProvider A cyclical dependency was detected between the constructors of two services.
Activation path: 3) Injection of dependency ModelValidatorProvider into parameter defaultModelValidatorProviders of constructor of type DefaultModelValidatorProviders 2) Injection of dependency DefaultModelValidatorProviders into parameter defaultModelValidatorProviders of constructor of type NinjectDefaultModelValidatorProvider
- Request for ModelValidatorProvider
Suggestions:
- Ensure that you have not declared a dependency for ModelValidatorProvider on any implementations of the service.
- Consider combining the services into a single one to remove the cycle.
- Use property injection instead of constructor injection, and implement IInitializable if you need initialization logic to be run after property values have been injected.