简体   繁体   中英

Error with schemaVersion of Azure Project

I have an Azure project in TFS that used to work well.

I've just get the latest version and rebuilt the project and now I get the following version:

Error   131 The XML specification is not valid: The 'schemaVersion' attribute is invalid - The value '2013-10.2.2' is invalid according to its datatype 'http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition:SchemaVersion' - The Enumeration constraint failed.  D:\TFS_BOIRA\PROPPOSV3\BACKEND\ServiceLayer.Azure1\ServiceDefinition.csdef  2   125 ServiceLayer.Azure1

The same configuration in another computer works well.

I have checked the version of Azure Tools of both computers and we have different versions. In my computer (Where I get the error) I have azure tools 2.3, whereas in the other computer where it works well the version is 2.2.

May it be a problem of azure tools versions?

When I add the role to the Azure cloud project, the assemblies: Microsoft.WindowsAzure.Diagnostics Microsoft.WindowsAzure.ServiceRuntime

are updated to version 2.3.0.0, and I need them in version 2.2.0.0.

Do I have to reinstall my azure tools to the version 2.2?

Thanks

In addition to Ingrid's answer, you need to get the latest schema version within the ServiceDefinition (.csdef) and ServiceConfiguration (.cscfg) files, and it is not good enough to just change the raw version value (eg 2.3), you also need the new version date:

2.3: schemaVersion="2014-01.2.3"

2.4: schemaVersion="2014-06.2.4"

<ServiceConfiguration serviceName="MyCoolCloudProjectName" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2014-06.2.4">

<ServiceDefinition name="MyCoolCloudProjectName" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-06.2.4">

You need to keep this in sync if you are working on two different machines. Either bring both up to 2.3 or revert. Keep in mind that as part of upgrading it may have changed config files which you haven't checked in yet.

Finally what it worked for me was reverting the version of Azure Tools, as @Steve Newton has said.

How to revert the version it tis explained here:

http://social.msdn.microsoft.com/Forums/en-US/8701b03a-804f-4953-9ea0-01064aa4dc16/downgrade-from-18-tools-to-17?forum=azuretfs .

What I did was:

1.Modify the .ccproj file: the following two tags changing 2.3 to 2.2.

< ProductVersion>2.2< /ProductVersion>

< CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.2\< /CloudExtensionsDir>

2.Open the files ServiceConfiguration.Cloud.cscfg and ServiceDefinition.csdef and change the version there.

I have the same kind of error

[my config: java/eclipse or jenkins/azure eclipseplugin/azure sdk]

ServiceDefinition.csdef (2, 128): Error  CloudServices051 : The XML specification is not valid: The 'schemaVersion' attribute is invalid - The value '2014-06.2.4' is invalid according to its datatype 'http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition:SchemaVersion' - The Enumeration constraint failed.

I had no error on my workstation using Eclipse or console but I got this error on my Jenkins instance. It was maybe a difference between SDK. I updated both ( jenkins and my workstation) with the same SDK version but I keep this error... :(

The only workaround I found to have a success build was to remove this attribute from ServiceDefinition.csdef root element.

<ServiceDefinition xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" name="AzureDeploymentProject">

In my build I keep the following warning but the package is build with success.

ServiceDefinition.csdef: Warning  CloudServices040 : The 'schemaVersion' attribute is unspecified. Please set the attribute to avoid this warning.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM