Pergunta

I am working on a project which depends on post-build commands to transfer assemblies across the projects. I have post-build command which looks like following:

xcopy /y "$(ProjectDir)\bin\$(Configuration)\*" "$(SolutionDir)\Destination Project\bin\$(Configuration)\Plugins\"

This command used to work everytime. But since I got latest code from our source control, it has stopped copying the files from the source directory to the target directory. I am not sure what might have caused it because source project's build is always successful.

What places can I be checking for possible changes/errors?

Foi útil?

Solução

There are several possible reasons for such an issue

  • the file system structure has changed and the target directory does not exist any more
  • the Visual Studio solution has changed since last time and the source directory does not exist any more
  • you have the destination Visual Studio project open and the destination files are in use
  • you have the destination application running and the destination files are in use
  • Visual Studio does not build successfully and therefore does not run the post build step
  • you have no permissions to write to the destination directory
  • you have deleted xcopy
  • you have no permissions to execute xcopy
  • the virus scanner prevents copying the files

Well, not all of them are very likely, but they all have one thing in common: the way to debug this issue.

Get a copy of Process Monitor, add a filter for Path contains "Destination Project\bin" and then perform a build. All file accesses to the relevant files should appear and you can see the status (success, failure, ...) and you should be able to find the actual cause of the problem.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top