title: Asp.net Core Internal controllers
body: <p>I have a controller which have an action with a route, as shown below:</p>
  
  <pre><code>Route("{resourceType}/{id}")
  </code></pre>
  
  <p>my dll have some helper classes which is used by for example by another asp .net core application, now since that application also have similar routes so indirectly my controller starts conflicting with them</p>
  
  <p>I solved this issue in web api, by marking my controller as internal and selecting this controller in the implementaion of <a href="https://msdn.microsoft.com/en-us/library/system.web.http.dispatcher.ihttpcontrollertyperesolver(v=vs.118).aspx" rel="nofollow noreferrer">IHttpControllerTypeResolver</a> for my application.</p>
  
  <p>Currently I am transferring my code to asp .net core 2.0 and I'm facing a similar problem, I tried to handle this problem using the code below - </p>
  
  <pre><code>serverInstance = new WebHostBuilder().
                  UseConfiguration(config)
                  .UseKestrel()
                  .UseStartup&lt;Startup&gt;()
                  .ConfigureServices(collection =&gt; {
                      // only fhir controller in cloud.
                      collection.AddMvc().ConfigureApplicationPartManager(manager =&gt;
                      manager.ApplicationParts.Clear())
                          .ConfigureApplicationPartManager(manager =&gt; {
                              manager.ApplicationParts
                              .Add(new TypesPart(typeof(FhirController)));
                              collection.AddSingleton&lt;IFhirConfiguration&gt;(inputConfig);
                          })
                          .AddControllersAsServices();
                  })
                  .Build();
  </code></pre>
  
  <p>But the above code did not help, and FhirController is not detected if it is <strong>internal</strong>, if it's public it works, any idea how can I fix it?</p>