Load Assembly Dynamically

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

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

Set the Output directory with

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

To load Assembly the best approach is to use

Assembly module = Assembly.LoadFrom(filePath);

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

B.IsAssignableFrom(A)

 


Revision #1
Created 2024-04-16 13:01:39 UTC by Admin
Updated 2024-08-30 11:20:50 UTC by Admin