简体   繁体   English

Azure项目的schemaVersion出错

[英]Error with schemaVersion of Azure Project

I have an Azure project in TFS that used to work well. 我在TFS中有一个Azure项目,以前工作得很好。

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. 我检查了两台计算机的Azure工具版本,我们有不同的版本。 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. 在我的计算机中(我得到错误的地方)我有azure工具2.3,而在另一台运行良好的计算机中,版本是2.2。

May it be a problem of azure tools versions? 可能是azure工具版本的问题?

When I add the role to the Azure cloud project, the assemblies: Microsoft.WindowsAzure.Diagnostics Microsoft.WindowsAzure.ServiceRuntime 当我将角色添加到Azure云项目时,程序集:Microsoft.WindowsAzure.Diagnostics Microsoft.WindowsAzure.ServiceRuntime

are updated to version 2.3.0.0, and I need them in version 2.2.0.0. 更新到版本2.3.0.0,我在版本2.2.0.0中需要它们。

Do I have to reinstall my azure tools to the version 2.2? 我是否必须将我的azure工具重新安装到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: 除了Ingrid的答案之外,您还需要在ServiceDefinition(.csdef)和ServiceConfiguration(.cscfg)文件中获取最新的模式版本,并且仅仅更改原始版本值(例如2.3)还不够,还需要新版本日期:

2.3: schemaVersion="2014-01.2.3" 2.3:schemaVersion =“2014-01.2.3”

2.4: schemaVersion="2014-06.2.4" 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. 要么将两者都带到2.3或还原。 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. 最后它对我有用的是恢复Azure工具的版本,正如@Steve Newton所说。

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 . 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. 1.修改.ccproj文件:以下两个标签将2.3更改为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. 2.打开文件ServiceConfiguration.Cloud.cscfg和ServiceDefinition.csdef并更改其中的版本。

I have the same kind of error 我有同样的错误

[my config: java/eclipse or jenkins/azure eclipseplugin/azure sdk] [我的配置:java / eclipse或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. 我使用Eclipse或控制台在我的工作站上没有错误但是我的Jenkins实例上出现了这个错误。 It was maybe a difference between SDK. 它可能是SDK之间的区别。 I updated both ( jenkins and my workstation) with the same SDK version but I keep this error... :( 我用相同的SDK版本更新了两个(jenkins和我的工作站),但我保留了这个错误...... :(

The only workaround I found to have a success build was to remove this attribute from ServiceDefinition.csdef root element. 我发现成功构建的唯一解决方法是从ServiceDefinition.csdef根元素中删除此属性。

<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.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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