Error on Create Sevice Contrat Translator

Topics: General Discussion Forum
Aug 7, 2007 at 5:08 PM
Hi all,
I am trying to create a Contract Translator between a Business Entity (created with the Data Access Software Factory Recipe) and
one Data Type created from an xsd file using xsd.exe.
I tried to change the machine but I got always the same error. Do you think that using the new version of GAT/GAX can help?

This is the error detail:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Microsoft.Practices.RecipeFramework.ActionExecutionException: An exception occurred during the binding of reference or execution of recipe GenerateServiceContractTranslatorFromWizard. Error was: Action GenerateTranslatorClass failed to execute:
Exception of type 'Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TemplateException' was thrown..
You can remove the reference to this recipe through the Guidance Package Manager. ---> Running transformation: System.ArgumentNullException: Value cannot be null.
Parameter name: obj
at Microsoft.VisualStudio.TextTemplating.ToStringHelper.ToStringWithCulture(Object obj)
at Microsoft.VisualStudio.TextTemplating56021b30be1f4a96828765fb7384a058.GeneratedTextTransformation.TransformText()
----------------------------------------------------------------------------------------------------

--- End of inner exception stack trace ---
at Microsoft.Practices.RecipeFramework.Recipe.UndoExecutedActionsAndRethrow(Exception ex)
at Microsoft.Practices.RecipeFramework.Recipe.ExecuteActions(IDictionaryService readOnlyArguments, IDictionaryService arguments, ITypeResolutionService resolution)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(IAssetReference reference)
at Microsoft.Practices.RecipeFramework.RecipeReference.OnExecute()
at Microsoft.Practices.RecipeFramework.AssetReference.Execute()
at Microsoft.Practices.RecipeFramework.VisualStudio.RecipeMenuCommand.OnExec()
at Microsoft.Practices.RecipeFramework.VisualStudio.AssetMenuCommand.Invoke()
----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thank in advice

Stefano
Aug 8, 2007 at 2:58 PM
Hi Stefano,
Did you check that your source class has a valid namespace?
I got the same problem and solved it adding NameSpace to the Data Contract Class.
Regards Stelio




stefano wrote:
Hi all,
I am trying to create a Contract Translator between a Business Entity (created with the Data Access Software Factory Recipe) and
one Data Type created from an xsd file using xsd.exe.
I tried to change the machine but I got always the same error. Do you think that using the new version of GAT/GAX can help?

This is the error detail:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Microsoft.Practices.RecipeFramework.ActionExecutionException: An exception occurred during the binding of reference or execution of recipe GenerateServiceContractTranslatorFromWizard. Error was: Action GenerateTranslatorClass failed to execute:
Exception of type 'Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TemplateException' was thrown..
You can remove the reference to this recipe through the Guidance Package Manager. ---> Running transformation: System.ArgumentNullException: Value cannot be null.
Parameter name: obj
at Microsoft.VisualStudio.TextTemplating.ToStringHelper.ToStringWithCulture(Object obj)
at Microsoft.VisualStudio.TextTemplating56021b30be1f4a96828765fb7384a058.GeneratedTextTransformation.TransformText()
----------------------------------------------------------------------------------------------------

--- End of inner exception stack trace ---
at Microsoft.Practices.RecipeFramework.Recipe.UndoExecutedActionsAndRethrow(Exception ex)
at Microsoft.Practices.RecipeFramework.Recipe.ExecuteActions(IDictionaryService readOnlyArguments, IDictionaryService arguments, ITypeResolutionService resolution)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(IAssetReference reference)
at Microsoft.Practices.RecipeFramework.RecipeReference.OnExecute()
at Microsoft.Practices.RecipeFramework.AssetReference.Execute()
at Microsoft.Practices.RecipeFramework.VisualStudio.RecipeMenuCommand.OnExec()
at Microsoft.Practices.RecipeFramework.VisualStudio.AssetMenuCommand.Invoke()
----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thank in advice

Stefano


Dec 20, 2007 at 6:58 AM
Hey stefano your problem is solved???? please help me i am stucked here and facing same problem...pls help me fast....I need it urgent.


Kiran
Dec 20, 2007 at 8:54 AM
Our Business Enity class didn't have a namespace. We added a namespace and, after that, the recipe worked well.
I hope this can be usefull.

regards

Stefano
Dec 20, 2007 at 10:17 AM
Hello Stefano,
Thanks for so nice and fast reply.

Actually there is some magic in ur Thread. Because after posting my query one of my colleague found its solution actually we need to add namespace to our class which we are going to use as a DataType means CustomerService.DataType.

For others who may face the same problem.. I am repeating steps here so they can save there time.
1.when generate a class from xsd using xsd.exe at that time provide /namespace:<ur NAMESPACE> for example /namespace:CustomerService.DataType.

2. that's it this will make u Happy to go ..


I have another problem also that when i generate a type from this it shows me the following errors
----------------------------------------------------------------------------------------------------------------------
Error 1 Duplicate 'System.CodeDom.Compiler.GeneratedCodeAttribute' attribute C:\Documents and Settings\Administrator\Desktop\Appns My\CustomerService\CustoemerService.DataTypes\Customer.cs 19 6 CustoemerService.DataTypes

Error 3 Duplicate 'System.ComponentModel.DesignerCategoryAttribute' attribute C:\Documents and Settings\Administrator\Desktop\Appns My\CustomerService\CustoemerService.DataTypes\Customer.cs 22 6 CustoemerService.DataTypes

Error 2 Duplicate 'System.SerializableAttribute' attribute C:\Documents and Settings\Administrator\Desktop\Appns My\CustomerService\CustoemerService.DataTypes\Customer.cs 20 6 CustoemerService.DataTypes

Error 4 Duplicate 'System.Xml.Serialization.XmlRootAttribute' attribute C:\Documents and Settings\Administrator\Desktop\Appns My\CustomerService\CustoemerService.DataTypes\Customer.cs 24 6 CustoemerService.DataTypes
----------------------------------------------------------------------------------------------------------------------
i have fixed this errors by commenting those lines but i don't think itits proper so please if u know it than ping me back..

Thanks,