This error appears in my Visual Studio 2012 error list when using the Azure SDK version 2.2.
It also refers to a file:
Error 5 The "ValidateServiceFiles" task failed unexpectedly. System.IO.FileNotFoundException: Could not find file 'C:\Project\Data.Contracts\ServiceConfiguration.Local.cscfg'. File name: 'C:\Project\Data.Contracts\ServiceConfiguration.Local.cscfg' at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at Microsoft.ServiceHosting.Tools.Internal.Translations.Translate.ServiceConfigurationFromFile(Boolean useInternalSchema, String serviceConfigurationFile, ValidationHandler validationHandler) at Microsoft.ServiceHosting.Tools.MSBuildTasks.ValidateServiceFiles.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.2\Microsoft.WindowsAzure.targets 669 5 Azure.
The file definitely exists and has the correct attributes. It is strange that the file is not in the specified path, but in a different path. It is as if the ValidateServiceFiles process is confused and is looking for a file in the wrong folder.
Rebooting the Azure user role project and cloud projects does not help, does not restart the computer. Sometimes you can make progress by manually creating each cloud project in the solution. But the error always returns, sometimes after receiving the last from the initial control, although it is essentially random.
A detailed build log shows this:
58>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.2\Microsoft.WindowsAzure.targets(3259,5): warning MSB3026: Could not copy "ServiceConfiguration.Local.cscfg" to "bin\Debug\ServiceConfiguration.cscfg". Beginning retry 2 in 1000ms. Could not find file 'ServiceConfiguration.Local.cscfg'.
But that does not help. The file exists in the correct place in the project (not the path specified in the error message)
There is little to learn on the Internet about how to debug the ValidateServiceFiles process.