2011-08-29 4 views
1

C# .NET에서 프로젝트를 작업하는 동안 정전이 발생하여 프로그램을 디버깅 할 수 없습니다. 이러한 오류가 발생합니다.내 프로그램을 더 이상 디버그 할 수 없습니다.

Error 1 Unable to copy file "C:\Users\Nihal\Documents\Visual Studio 2005\Projects\InfortecManagementSystem\InfortecManagementSystem\InfortecInternational.mdf" to "bin\Debug\InfortecInternational.mdf". The process cannot access the file 'C:\Users\Nihal\Documents\Visual Studio 2005\Projects\InfortecManagementSystem\InfortecManagementSystem\InfortecInternational.mdf' because it is being used by another process. InfortecManagementSystem 

Error 2 Unable to copy file "C:\Users\Nihal\Documents\Visual Studio 2005\Projects\InfortecManagementSystem\InfortecManagementSystem\InfortecInternational_log.ldf" to "bin\Debug\InfortecInternational_log.ldf". The process cannot access the file 'C:\Users\Nihal\Documents\Visual Studio 2005\Projects\InfortecManagementSystem\InfortecManagementSystem\InfortecInternational_log.ldf' because it is being used by another process. InfortecManagementSystem 

다시 작동 시키려면 어떻게해야합니까?

+0

SQL 서버를 다시 시작하십시오. 시작 -> 실행 -> services.msc – Johan

+0

일부 프로그램이 파일을 잠갔습니다. vnet을 다시 시작하여 vnet인지 확인하십시오. 그렇지 않은 경우 다른 프로그램이 프로그램을 사용하는지 확인하고 로그 아웃/다시 시작하여 작동하는지 확인하십시오. – Peter

+0

서비스 작업 관리자 끝으로 이동 관리 스튜디오 또는 다른 것과 같은 .mdf 파일을 사용하고있는 응용 프로그램을 처리합니다. 그런 다음 솔루션 재구성을 다시 시도하십시오. 컴파일 오류가 없는지 확인하십시오. 행운을 빕니다! – vinayvasyani

답변

0

원본 파일이 잠긴 것처럼 보이므로 다시 작성할 수 없습니다. 어떤 종류의 파일 잠금 장치가 있다면 작동 할 것입니다. 그렇지 않으면 현재 위치에서 해당 위치를 삭제하고 다음에 디버그 모드로 실행하려고 할 때 다시 빌드 할 수 있습니다.

+0

답변 해 주셔서 감사합니다. 파일을 수동으로 삭제 한 다음 다시 작성하면 문제가 해결되지 않았습니다. 나는 이것을 어딘가에서 발견했고 그것은 효과가 있었다. 솔루션 탐색기에서 > 속성> 이벤트, '사전 빌드 이벤트 명령 줄'에서 , 델 C 빌드 : 빈 \ \ \에 SampleProject \에 SampleProject : 델 C database.mdf \에 SampleProject \에 SampleProject \ 빈 \ 디버그 \를 Debug \ database.ldf – Lihini

2

파일이 다른 프로세스에서 잠겼습니다. Handle은이 문제를 해결하는 Windows/SysInternals 도구입니다. 현재 해당 파일을 사용중인 프로세스를 알려줍니다.

핸들을 다운로드하고 명령 프롬프트로 이동하여 "handle 'C : \ Users \ Nihal \ Documents \ Visual Studio 2005'"를 입력하십시오.

1

감사합니다. 파일을 수동으로 삭제 한 다음 다시 작성하면 문제가 해결되지 않았습니다. 나는 이것을 어딘가에서 발견했고 그것은 효과가 있었다.

In Solution Explorer>Properties>Build Events, 
In 'Pre-build event command line', 

    del C: \ SampleProject \ SampleProject \ bin \ Debug \ database.mdf 
    del C: \ SampleProject \ SampleProject \ bin \ Debug \ database.ldf 

여기에 the link입니다.

관련 문제