Remove unimportant information from Example
- Dominant language
- No language data
- Stars
- 4.8k
- Forks
- 6.1k
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 370
Description
## Current Situation
Trying to follow the "Create a .NET Core application with plugins" I'm forced to scroll through hundreds of lines of no interest, trying to find the tiny pieces of information that are important. This is unnecessarily wasting my time and keeping me from providing a solution.
For the sake of the example, it's unnecessary to know how to create an application. It's unimportant to know what kind of plug-ins are to be instantiated. It's redundant to see any code not directly tied to [`AssemblyLoadContext`](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext) et al.
## Desired Situation
The example should be as concise as it can be, yet explaining the _important_ parts. So, please remove every text not pertaining to [`AssemblyLoadContext`](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext) et al.
Just write something like:
> - Given there's an app trying to load plug-ins that are implementing the `InterFace` interface.
> - Given these plug-ins are residing at `string pathToDirectory`.
> - The app gets these loaded by following code: …
> - To run any plug-in, call them like this: …
> - If both, plug-ins and application, share the same set of solution interfaces (defined in a separate project and linked to by both, application and plug-ins), for the application to cast a plug-in to the interface known to both, do this: …
That's just two lines of introductory text plus three short example blocks.
### The final item may need some clarification:
Given the VS solutions is consisting of three projects:

Both, **Application Project** and **Plug-In Project**, have a reference to the **Shared Interfaces** project, so they can use the interfaces defined in the **Shared Interfaces** project.
Given the Shared Interfaces project contains an interface definition like this:
```c#
public interface IPlugInBase { }
```
The plug-in project contains a class definition like this:
```c#
public class PlugIn1 : IPlugInBase {}
```
And the application project contains a collection of `IPlugInBase` objects:
```c#
public class Program
{
private List plugIns;
public static void Main(string[] args) {}
}
```
Now, given that the `Plug-In Project\bin\Debug\net7.0\` output is saved to a location different from `Application Project\bin\Debug\net7.0\`, then both folders will contain their own copy of `Shared Interfaces\bin\Debug\net7.0\`:
```
|- Application.dll
|- SharedInterfaces.dll
|- PlugIns
|- PlugIn1.dll
|- SharedInterfaces.dll
```
How is the **application** supposed to cast `PlugIn1` to `IPlugInBase`?
---
#### Document Details
⚠ *Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.*
* ID: 06023407-704f-0ace-e89a-eedd9f95a007
* Version Independent ID: f25a6e1a-cb10-867b-0522-a377bf9d016b
* Content: [Create a .NET Core application with plugins - .NET](https://learn.microsoft.com/en-us/dotnet/core/tutorials/creating-app-with-plugin-support)
* Content Source: [docs/core/tutorials/creating-app-with-plugin-support.md](https://github.com/dotnet/docs/blob/main/docs/core/tutorials/creating-app-with-plugin-support.md)
* Product: **dotnet-fundamentals**
* GitHub Login: @jkoritzinsky
* Microsoft Alias: **jekoritz**
Contributor guide
Assessment
This issue has not been assessed yet.