?
Solved

how can i correct it C#

Posted on 2010-11-22
6
Medium Priority
?
983 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 668 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 668 total points
ID: 34194448
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Assisted Solution

by:Richard Lee
Richard Lee earned 664 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

801 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