问题
I tried to deploy from TFS, but receiving the error:
Exception Message: Invalid enum value 'FailedStartingRole' cannot be deserialized into type 'Microsoft.TeamFoundation.Deployment.Workflow.AzureManagement.v1_7.InstanceStatus'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute. (type SerializationException)
Exception Stack Trace:
at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Any idea or similar encounter before?
回答1:
When I had the similar issue, I had a previously failed deployment in Azure. So to fix TFService error was just to delete a faulty deployment from Azure management portal.
回答2:
For a SerializationException type, check that a classes of WCF are attributed with a attribute DataContractAttribute and there properties with DataMemberAttribute. Enums items need be attributed with an attribute EnumMemberAttribute.
I have some problems with Windows Azure 1.7, do you have another versions of Windows Azure installed?, verify that your are using WindowsAzure.Client. I you do an upgrade is posible then you have conflicts.
来源:https://stackoverflow.com/questions/17688386/azure-tfs-deployment-error-invalid-enum-value-failedstartingrole-cannot-be-de