I have a problem with my .NET project on TeamCity. Everything is working OK except for sometimes MSBuild fails to build because a file named "bin" is created in the project folder instead of a bin directory. I try to delete the "bin" file and re-run the configuration then it works OK, but sometimes when TeamCity does a clean checkout and rebuild the solution then the problem happens again: a file named "bin" has been already created so that MSBuild can not create a bin directory and copy output files to that directory.
Below is some text extracted from the Build log:
[MyWebProject.csproj] PrepareForBuilBd
[21:06:46][PrepareForBuild] MakeDir
[21:06:46][MakeDir] Creating directory "bin\".
[21:06:46][MakeDir] C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(932, 5): warning MSB3191: Unable to create directory "bin\". Cannot create "E:\TeamCity\VCS\MyWebProject\MyWebProject\bin" because a file or directory with the same name already exists.
[21:06:46][MakeDir] The previous error was converted to a warning because the task was called with ContinueOnError=true.
[21:06:46][MakeDir] Creating directory "Help\".
[21:06:46][MakeDir] Build continuing because "ContinueOnError" on the task "MakeDir" is set to "True".