title: asp.net core web api project how to with fluentvalidation auto-validation
body: <p>I want to use fluentvalidation to automatically verify exceptions, but I can’t do this now. If I put the Validator in the same one project, it will work, but if I put it Validator in another library, it will not work。
  The following project one</p>
  <pre><code>public class TestValidator : AbstractValidator&lt;WeatherForecast&gt;
  {
      public TestValidator()
      {
          RuleFor(x =&gt; x.Summary).NotEmpty().WithMessage(&quot;Username or email are required&quot;);
      }
  
  }
  </code></pre>
  <p>The following project two</p>
  <p>I said that registration and verification are placed in different projects, which leads to abnormal verification.</p>
  <pre><code>services.AddMvc(options =&gt;
      {
          options.Filters.Add(new ExceptionFilter());
      })
      .AddFluentValidation(options =&gt;
      {
          options.RegisterValidatorsFromAssemblyContaining&lt;Startup&gt;();
      });
  </code></pre>