Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in ModelValidatorProvider #12

Open
jormenjanssen opened this issue Apr 29, 2014 · 3 comments
Open

Error in ModelValidatorProvider #12

jormenjanssen opened this issue Apr 29, 2014 · 3 comments

Comments

@jormenjanssen
Copy link

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

  1. Request for ModelValidatorProvider
@jinyinmao
Copy link

I had the same problem when I upgraded my packages with NuGet yesterday.

@jormenjanssen
Copy link
Author

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

@sgmeyer
Copy link

sgmeyer commented Jul 3, 2014

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

  1. Request for ModelValidatorProvider

Suggestions:

  1. Ensure that you have not declared a dependency for ModelValidatorProvider on any implementations of the service.
  2. Consider combining the services into a single one to remove the cycle.
  3. 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

  1. Request for ModelValidatorProvider

Suggestions:

  1. Ensure that you have not declared a dependency for ModelValidatorProvider on any implementations of the service.
  2. Consider combining the services into a single one to remove the cycle.
  3. Use property injection instead of constructor injection, and implement IInitializable
    if you need initialization logic to be run after property values have been injected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants