Generate Class From XSD - CTE for SEFAZ Webservice

Asked

Viewed 817 times

1

Referring to the generation of NFE and CTE classes from XSD for use in the SEFAZ Webservices.

I have had some problems of ambiguity in the name of the generated classes. I used the Visual Studio Tools tool to generate the class from XSD.

However when importing a second . Cs generated for Solution ( even if in different project ) it accuses several ambiguities between classes. How can I fix this without affecting the final schema in xml generation?

  • This command line can be used to generate the Classes, having the NF-e Schemas: See https://answall.com/a/218780/5704

1 answer

3


If xsd.exe is generating classes whose names conflict with other classes in your project, you can specify a namespace different when you call her:

xsd.exe /namespace:Meu.Novo.Namespace <outros parametros>

A project can have classes with the same name, as long as they are in different namespaces.

  • Thanks @carlosfigueira I managed to solve easily with this command was that same the problem.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.