Reputation: 361
I upgraded my Azure project from 2.1 to the latest, 2.9. Everything seems to have updated but I keep getting the following error:
The XML specification is not valid: The 'schemaVersion' attribute is invalid - The value '2015-04.2.6' is invalid according to its datatype 'http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition:SchemaVersion' - The Enumeration constraint failed.
Everything seems to be looking at the 2.9 SDK but I can't make the error go away.
Any help would be greatly appreciated, thanks!
Upvotes: 0
Views: 876
Reputation: 531
From the error message I am assuming that it is a Cloud service(WebRole/WorkerRole) project. The version string is in the first line of your cscfg and csdef files and the error you mentioned is thrown by the ValidateServiceFiles . Towards the bottom of the project file (*.ccproj) there is a import element for the Azure targets; please ensure that the path is pointing to v2.9 targets.
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.9\</CloudExtensionsDir>
The path resolves to something similar to "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Windows Azure Tools\2.9\Microsoft.WindowsAzure.targets"
If this is not a problem, try a command line build with verbose output. From "Developer Command Prompt for VS 2013/2015"
msbuild /v:d
You should be able to locate the build target that is throwing the error. Most probably it is ValidateServiceFiles target in C:\Program Files\Microsoft SDKs\Azure.NET SDK\v2.9\bin\Microsoft.ServiceHosting.Tools.MSBuildTasks.dll
Upvotes: 2