# Load Assembly Dynamically

In order to Copy NuGet dependecies to the output folder add this to classlibrary.csproj:

```xml
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
```

Set the Output directory with

```xml
<BaseOutputPath>$(SolutionDir)AppName\bin</BaseOutputPath>
```

To load Assembly the best approach is to use

```c#
Assembly module = Assembly.LoadFrom(filePath);
```

To check if type A can be assigned to a variable with type B:

```c#
B.IsAssignableFrom(A)
```