Error While trying to run the project: could not load file or assembly 'Windowsformapplication1' or one of its dependencies?
Solution 1
Make sure your project's name doesn't have an apostrophe, as they can cause errors.
Solution 2
I have found three simple steps:
GO TO START ---> RUN
- Type
prefetch
and delete all files - Type
recent
and delete all files - Type
%temp%
and delete all files
Solution 3
Probably, one of designed component thrown unhandled exception during initialization of events. Generally it's occurs when you remove a method (1) for delegate (E.g.TexChanged, Click) but you not remove the reference(2) for this method in design source (Form1.Designer.cs).
//1.
private void txtBox_TextChanged(object sender, EventArgs e)
{
}
//2.
this.txtBox.TextChanged += new System.EventHandler(this.txtBox_TextChanged);
Solution 4
I found 4 simple steps to solve this error:
- Visual Studio => Run as Admin
- Project Properties => Build => Platform Target : Any Cpu
- Build => Clean
- Run
Solution 5
4 steps to solved a problem :
open your project.
from solution explorer select your project name Beside them icon" c#" and right click and select properties.
click Application > startup object: (Not set) > change to (your project name) .program.
run a project (F5)
Now the project is working successfully.
Saeed Khan
Updated on June 13, 2022Comments
-
Saeed Khan almost 2 years
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.
-
user1703401 over 10 yearsWhere did the spaces in the name come from? The boilerplate name for a winforms app is WindowsFormsApplication1. If you rename it then do pick a name without spaces to avoid accidents. Look at the Error window to ensure that the project built correctly.
-
Sergey Kalinichenko over 10 yearsIt looks like one of the assemblies you are referencing is missing. If you've spent two days chasing this already, it may be faster to tart from scratch, and move the code into a new project, trying to see that your program remains runnable after each modification that you make.
-
-
Andrew Uricchio over 9 yearsThis worked for me. My assembly name had an apostrophe; removing it compiled the application.