0

I wanted to create new console project in c# and met a problem. When I debug it, I get empty console...

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
                Console.WriteLine("Hello");
        }

    }
}

After that i tried to debug it again and got this:

Error 11 Could not copy "obj\Debug\ConsoleApplication1.exe" to "bin\Debug\ConsoleApplication1.exe". Exceeded retry count of 10. Failed. ConsoleApplication1

Error 12 Unable to copy file "obj\Debug\ConsoleApplication1.exe" to "bin\Debug\ConsoleApplication1.exe". The process cannot access the file 'bin\Debug\ConsoleApplication1.exe' because it is being used by another process. ConsoleApplication1

I tried to kill process with task manager, but it starts again right at that second... Windows Forms Application debugs good.

Same problem with c++

(scanned PC with Doc. Web and Avast in safe mode and without it)

Little Fox
  • 1,212
  • 13
  • 39

1 Answers1

1

Try to clean and build (rebuild)..if it wont help, close Visual Studio, delete bin and obj folders from your harddrive and launch VS again. Should solve the problem.

Check this related post Visual Studio "Could not copy" .... during build

Oh and try to disable Antivirus (especially if its Avast)..

Community
  • 1
  • 1
Petr Adam
  • 1,425
  • 11
  • 23