0
Hello!
In my project I have an xml file and I want to copy this file to the output directory at the time of compilation so that it stays together with the executable file and other files. For this I created a post-compilation event to copy this file to the output directory. But when compiling it is failing the event. I’m almost sure it must be a related error on the way to the file but I’m not sure.
Here’s the event briefing I’m trying to get:
copy SqlCommands.xml $(OutDir)
Error:
Gravidade Código Descrição Projeto Arquivo Linha Estado de supressão
Erro The command "copy SqlCommands.xml ..\bin\Debug\" exited with code 1. FoxVideoManagerBackend C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets 4714
Ton Angelo’s answer solved in a simpler way, but it also worked through events using variables
ProjecDir
andTargetDir
. Taking advantage of the hook of the question, why is it necessary to wrap the variables in quotes? I’m a little rusty on DOS, but it will be due to spaces in folder names?– Matheus Saraiva
His answer took wave, that yes hahaha, in my case I do not use because I give a
-replace
in the middle of the road there and such. Look at the quotes I’ll confess I was making a mistake in this until a friend here hit his eye, talked about the spaces and had the quotes put. It worked perfectly and I didn’t do any more research than he said.– Ricardo