Jump to content
  • Revista PROGRAMAR: Já está disponível a edição #60 da revista programar. Faz já o download aqui!

Sign in to follow this  
Sir Pereira

Unable to copy...

Recommended Posts

Sir Pereira

Boas pessoal,

este problema já me anda a chatiar há algum tempo, e só consigo fazer Debug ao projecto pela 2ª vez ao reiniciar o Visual Basic.

Basicamente o erro é este:

Unable to copy file....The process was unable to access the file because it is being used by another program.


Encontrei agora uma "solução":

if exist "$(TargetPath)"*".locked" del "$(TargetPath)"*".locked"

if exist "$(TargetPath)" move "$(TargetPath)" "$(TargetPath)."%date:~4,2%%date:~7,2%%date:~10,4%_@_%time:~0,2%h%time:~3,2%m%time:~6,2%s%.locked

Adicionar isto no evento pre-build, mas ainda não entendi como chego lá.

How to Specify Pre-Build and Post-Build Events

To specify a build event


      With a project selected in Solution Explorer, on the Project menu, click Properties.


      Click the Compile tab.


      Click the Build Events button to open the Build Events dialog box.


      Enter the command-line arguments for your pre-build or post-build action, and then click OK.

Mas na tab de Compile, não tenho lá nenhuma Build Events.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.