Could not load file or assembly 'ConsoleApplication1'

Go To


I just open a new C# project , but when i want to compile it i give the title error . i search for this error but didn't find any result .

what am i going to do ?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
    class Program
        static void Main(string[] args)
            Console.WriteLine("hello world!");
2012-04-03 19:38
by user1259236
Did you rename the project after creating it? Did you try to restart visual studio and try again - Tudor 2012-04-03 19:40
is hello world the only thing you did to the project? Is it in a solution/project all alone? Also.. might want to add a Console.ReadLine(); after the write so it will stay open instead of just flashing - Tony 2012-04-03 19:41
no i dont rename it , n - user1259236 2012-04-03 19:43
Did you build the project? If you don't know, make sure by right clicking the project in the solution explorer and choose Build - Nico Schertler 2012-04-03 19:45
@Nico Schertler:yes i build the project first - user1259236 2012-04-03 19:46
And did it compile without errors? Look in the Output window. And do you see the .exe in the bin\Debug directory of the project? Double-click it to see what happens - Hans Passant 2012-04-03 20:27
no , i give this error : the application failed to properly . Thanks Hans , its from my p - user1259236 2012-04-03 21:57
Why do you need to use linq, collections.generic and text - Anish Gupta 2012-04-09 13:55


  • Try cleaning the project.
  • Make sure that the startup item isn't set to a non-existant ConsoleApplication1.
  • Whatever the main form of your project is, right click on it in Solution Explorer and select "Set as Start Up...".
  • Make sure that the Program.cs (or Program.vb) file is not attempting to load ConsoleApplication1.
2012-04-03 20:02
by Ami Schreiber
i think its a fault of my windows and i must reinstall it . Thanks Am - user1259236 2012-04-03 20:08
@user1259236 - don't forget to replace all electrical wiring in your entire house first - Henk Holterman 2012-04-03 20:21