Solved

how can i correct it C#

Posted on 2010-11-22
6
951 Views
Last Modified: 2012-05-10
Error      1      Unable to copy file "obj\x86\Debug\WindowsFormsApplication3.exe" to "bin\Debug\WindowsFormsApplication3.exe". The process cannot access the file 'bin\Debug\WindowsFormsApplication3.exe' because it is being used by another process.      WindowsFormsApplication3

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.IO;



namespace WindowsFormsApplication1

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }



        private void button1_Click(object sender, EventArgs e)

        {

            FolderBrowserDialog dlg = new FolderBrowserDialog();

            if (dlg.ShowDialog() == DialogResult.OK)

            {

                sorrceTextbox.Text = dlg.SelectedPath;

            }





        }





        private void textBox1_TextChanged(object sender, EventArgs e)

        {



        }



        private void button2_Click(object sender, EventArgs e)

        {

            FolderBrowserDialog dlg2 = new FolderBrowserDialog();

            if (dlg2.ShowDialog() == DialogResult.OK)

            {

                sorrceTextbox.Text = dlg2.SelectedPath;

            }



        }

    }

}

Open in new window

0
Comment
Question by:teera
6 Comments
 

Author Comment

by:teera
ID: 34194145
what is

 private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

it do  can i delete it


private void button1_Click(object sender, EventArgs e)

        {

            FolderBrowserDialog dlg = new FolderBrowserDialog();

            if (dlg.ShowDialog() == DialogResult.OK)

            {

                sorrceTextbox.Text = dlg.SelectedPath;

            }





        }





        private void textBox1_TextChanged(object sender, EventArgs e)

        {



        }



        private void button2_Click(object sender, EventArgs e)

        {

            FolderBrowserDialog dlg2 = new FolderBrowserDialog();

            if (dlg2.ShowDialog() == DialogResult.OK)

            {

                destTextbox.Text = dlg2.SelectedPath;

            }



        }



        private void textBox2_TextChanged(object sender, EventArgs e)

        {



        }

Open in new window

0
 
LVL 7

Accepted Solution

by:
mkobrin earned 167 total points
ID: 34194192
private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

is automatically created by visual studio when you double click on the text box. You can delete it, but after deleting it if you compile you may receive an error, because it is being referenced in the designer, so before you delete it, right click and select the option to find all references, delete the reference in the designer, and then come back and delete it.
0
 
LVL 29

Assisted Solution

by:Kumaraswamy R
Kumaraswamy R earned 167 total points
ID: 34194448
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 18

Assisted Solution

by:Richard Lee
Richard Lee earned 166 total points
ID: 34195695
If your application is already Running or the EXE file is lock for whatever reason then your application will not build since Visual Studio is trying to recreate the EXE and its currently locked.

Also when working with FolderBrowserDialog you should use it like this so the resources get disposed when the operation is complete.

BTW do you have two Visual Studio instances opened with the same Solution loaded?

DaTribe
using(FolderBrowserDialog dialog = new FolderBrowserDialog())
{
     if (dialog.ShowDialog() == DialogResult.OK)
     {
           destTextbox.Text = dialog.SelectedPath;
     }
}

Open in new window

0
 

Author Closing Comment

by:teera
ID: 34205642
thank all
0
 
LVL 18

Expert Comment

by:Richard Lee
ID: 34206026
Always glad to help Teera.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now