Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error While trying to run the project: could not load file or assembly 'Windowsformapplication1' or one of its dependencies?

Scenario: I have windows form application, it was working fine before two days but after last two days it is giving me error:

Error While trying to run the project: could not load file or assembly 'Windows form application 1' or one of its dependencies

I have tried two days to find solutions but all in vain.

Could any body please help me or suggest me some suggestions.

like image 740
Saeed Khan Avatar asked Dec 24 '13 07:12

Saeed Khan


People also ask

How do you fix Could not load file or assembly or one of its dependencies?

There are some workarounds for this issue: The dll file may not be in /bin folder. Just copy the dll file to /bin folder or set this preference Copy Local = True from Visual Studio. If the problem persists, check if the version of the assembly that is referenced is different than the version it is looking for.

Could not load file or assembly Could not load file or assembly?

In summary if you get the "Could not load file or assembly error", this means that either your projects or their references were built with a reference to a specific version of an assembly which is missing from your bin directory or GAC.

Could not load file or assembly one of its dependencies An attempt was made to load a program with an incorrect format?

“An attempt was made to load a program with an incorrect format.” That means that the assembly, which was to be loaded, was in an unexpected format. The format, in this case, refers most likely to the 64-bit build of an application being deployed to IIS, which is being run in 32-bits.

Could not load file or assembly Publickeytoken null or one of its dependencies?

This error usually means that the assembly was not found. Try verifying that the file exists in the directory where your application is running.


2 Answers

Make sure your project's name doesn't have an apostrophe, as they can cause errors.

like image 50
user3526560 Avatar answered Sep 30 '22 21:09

user3526560


I have found three simple steps:

GO TO START ---> RUN

  1. Type prefetch and delete all files
  2. Type recent and delete all files
  3. Type %temp% and delete all files
like image 41
user4154732 Avatar answered Sep 30 '22 21:09

user4154732