question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Assembly at Runtime

See original GitHub issue

When I load an application part with a controller in it, Swashbuckle doesn’t add the controller to the Swagger.

List<System.Reflection.Assembly> ExtraControllerAssemblies { get; set; }

public void ConfigureServices(IServiceCollection services)
{
  foreach (var assembly in ExtraControllerAssemblies)
  {
      services.AddMvc().AddApplicationPart(assembly);
  }
}

I can invoke actions on the runtime-loaded controller just fine, so it’s clearly loaded properly, but Swashbuckle hasn’t generated any Swagger for it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
chenyi1008commented, Sep 25, 2018

@AceCoderLaura Hi, were you able to resolve this issue? I’m seeing the same issue with swagger to work with an assembly which contains controllers and is loaded by Applicationpart.

0reactions
goorscommented, Jun 21, 2023

Same here …

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Can I load a .NET assembly at runtime and instantiate ...
You can load an assembly using *Assembly.Load** methods. Using Activator.CreateInstance you can create new instances of the type you want. Keep ...
Read more >
How to: Load Assemblies into an Application Domain
Learn how to load assemblies into an application domain in .NET. The recommended way is to use the static (or Shared) Load method...
Read more >
Dynamically Loading an assembly at Runtime and calling ...
This article explains how to load an assembly dynamically and call its method.
Read more >
Using Reflection to execute assemblies at runtime in C# - ...
In this article, we are going to use Reflection to load an assembly at runtime, extract a few methods from it and then...
Read more >
Understanding Dynamic Assembly Loading with ...
What is AssemblyLoadContext? The official documentation says. It provides a service of locating, loading, and caching managed assemblies and other dependencies.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found