I have a .sln solution file that references a .csproj project file that has a task after build:
<PropertyGroup> <PostBuildEvent> xcopy $(SolutionDir)\dir1\Somefle.xml $(ProjectDir) /Y /I </PostBuildEvent> </PropertyGroup>
The solution is built using msbuild with a task similar to the following:
<Target Name="CompileSolution"> <MSBuild Projects="@(SolutionToBuild)" Targets="Rebuild" Properties="Platform=Any CPU" /> </Target>
Now here is the weird part:
If I:
- run the build script (say c: \ MyWorkingCopy)
- rename the working copy folder (say c: \ YourWorkingCopy)
- run the build script again
In step 3, xcopy will fail because it will try to copy the file from "c: \ MyWorkingCopy" - which, of course, is not where the solution file is.
Why is msbuild using the old solution catalog? And is there a way to reset it?
(I am using the .NET Framework 3.5)
source share