Solved

how can i correct it C#

Posted on 2010-11-22
6
971 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

839 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