Skip to main content

Posts

Showing posts with the label Could not load file or assembly

Could not load file or assembly 'MySQL.Data' or one of its dependencies. Access is denied.

It is very common error with .net assemblies. When someone included dlls from outside, in the project, this kind of exceptions are generic. Here is the resolution. Open the file location ( MySql.Data.dll in this case ) Right click on dll and check its properties ( it should not be encrypted and should have right access permissions ) Run the project after assigning appropriate permissions. It should work now. Even after this if it does not work. Check in web.config that assembly information is added under <compilation> tag. It is advisable to included new dlls using nuget package reference. It will update its reference automatically. Happy Coding!!!

System.BadImageFormatException

Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. An attempt was made to load a program with an incorrect format. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.BadImageFormatException: Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. An attempt was made to load a program with an incorrect format. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Data.SQLite' could not be loaded. System.BadImageFormatException: System.Data.SQLite ...