Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how can i correct it C#

Posted on 2010-11-22
6
Medium Priority
?
988 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
Technology Partners: 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

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!

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

610 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