Validation 在Azure中,如何对错误进行故障排除;ValidateServiceFiles任务意外失败;?

Validation 在Azure中,如何对错误进行故障排除;ValidateServiceFiles任务意外失败;?,validation,visual-studio-2012,azure,Validation,Visual Studio 2012,Azure,使用Azure SDK 2.2版时,此错误显示在我的Visual Studio 2012错误列表中 它还引用一个文件: Error 5 The "ValidateServiceFiles" task failed unexpectedly. System.IO.FileNotFoundException: Could not find file 'C:\Project\Data.Contracts\ServiceConfiguration.Local.cscfg'. Fi

使用Azure SDK 2.2版时,此错误显示在我的Visual Studio 2012错误列表中

它还引用一个文件:

        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.
但这没用。文件存在于项目中的正确位置(不是错误消息中给出的路径)


关于如何调试ValidateServiceFiles进程,internet上几乎没有什么帮助。

经过大量搜索,我找到了答案。如蓝色问号所示,我有3个引用来发布磁盘上实际不存在的配置文件


此问题的任意性质是因为如果有人删除Azure portal上的云服务,则本地计算机上的构建无法工作。这是因为ValidateServiceFiles功能检查您的发布配置文件是否包含对Azure门户上现有云服务的引用

但是错误消息没有提到哪个项目有问题,只是列出了所有问题

所以,右键单击每个云项目,然后单击“发布”,并检查是否没有任何红色十字


如果您没有发布配置文件,您可能还需要右键单击云项目,单击发布,登录Azure,选择具有一致云存储和存储帐户的Azure订阅。然后取消发布,然后重建云项目。如果执行此操作,可能会神奇地出现对丢失的发布文件的引用。如果此操作似乎仅适用于您,请编辑项目的.ccproj.user文件。在这里,您可能会看到一个标记ActivePublishProfile,它引用了一个丢失的文件。
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'.