Solved

how can i correct it C#

Posted on 2010-11-22
6
966 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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