visual studio 2010 c# error
-
i have this error and the solutions that i found don't work. the error is: ------------- Error 12 Unable to copy file "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 Error 11 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Exceeded retry count of 10. Failed. WindowsFormsApplication1 Warning 9 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 9 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 Warning 8 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 8 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 Warning 7 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 7 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 Warning 6 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 6 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 Warning 5 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 5 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 ... THE SOLUTION THAT I FIND: -------------------------
add following lines of code to the pre-build event command line of your project.
if exist "$(TargetPath).locked" del "$(TargetPath).locked"
if exist "$(TargetPath)" if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"SECOND SOLUTION: --------------
if exist "$(ProjectDir)bin\$(TargetFileName).locked" del "$(ProjectDir)bin\$(TargetFileName).lo
-
i have this error and the solutions that i found don't work. the error is: ------------- Error 12 Unable to copy file "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 Error 11 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Exceeded retry count of 10. Failed. WindowsFormsApplication1 Warning 9 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 9 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 Warning 8 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 8 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 Warning 7 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 7 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 Warning 6 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 6 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 Warning 5 Could not copy "obj\x86\Debug\WindowsFormsApplication1.exe" to "bin\Debug\WindowsFormsApplication1.exe". Beginning retry 5 in 1000ms. The process cannot access the file 'bin\Debug\WindowsFormsApplication1.exe' because it is being used by another process. WindowsFormsApplication1 ... THE SOLUTION THAT I FIND: -------------------------
add following lines of code to the pre-build event command line of your project.
if exist "$(TargetPath).locked" del "$(TargetPath).locked"
if exist "$(TargetPath)" if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"SECOND SOLUTION: --------------
if exist "$(ProjectDir)bin\$(TargetFileName).locked" del "$(ProjectDir)bin\$(TargetFileName).lo
maybe it is the basic thing to say, but did you make sure the application properly shut down before compiling it? access the task manager and in it, under processes look for anything associated with your application also, did you try: Build>clean solution and then Build>rebuild Hope this Help Eyal
-
maybe it is the basic thing to say, but did you make sure the application properly shut down before compiling it? access the task manager and in it, under processes look for anything associated with your application also, did you try: Build>clean solution and then Build>rebuild Hope this Help Eyal