I want to load assemblies stored inside my project application folder on the c:
drive.
This is the code:
public static void Main(string[] args)
{
Assembly asm = null;
asm = Assembly.LoadFrom("C:\\SampleProj\\Workspace\\Test_App\\bin\\Debug\\Assemblies");
}
The exception I am getting is:
Could not load file or assembly 'file:///C:\SampleProj\Workspace\Test_App\bin\Debug\Assemblies' or one of its dependencies. Access is denied.
I tried the following, but the error remains the same:
- Keep the project in other drive and access assemblies from there
- Removed read-only permission from project folder-sub folders
- Granted full control permissions to Users in project folder properties
- Clicked on Unblock button for all DLL properties
Please help.
As I wrote in the comment, you are not specifying a valid path (you are specifying a folder when you need to specify a dll). If you want to load all the assemblies in that folder use this piece of code: