How to Read and Convert . xsd Extension File to a C#Class

Asked

Viewed 2,537 times

1

How to Read and Convert . xsd to a C# class for this purpose and convert the schema of the site Sefaz to can generate an xml with correct schema to be able to emit NFE.

  • That’s annoying p caramba...rsrs you want to generate the classes in C# from the schemas ? that’s it ?

  • if there’s any other way to take that schema over there and convert it to stay the same

  • See my answer https://answall.com/a/44245/5846

2 answers

6


This command line can be used to generate the Classes, having the NF-e Schemas:

xsd.exe nfe_v3.10.xsd xmldsig-core-schema_v1.01.xsd /c /edb

Note that you need to include the name of all imported Xsds in the main schema, so the nfe_v3.10 and xmldsig-core-schema_v1.01

XSD is accessible when using Visual Studio Command Prompt. Acessando Developer Command Prompt for VS 2017

  • converti gerei schema fez assinatura mais estou com erro falha no schema se tem algum schema xml para versão nova de Nfedistribuição para compartilhar

  • I was looking today for the official Schema of the new version of Nfedistribução, but also not found. If you find, please tell me.

  • I found: https://www.nfe.fazenda.gov.br/portal/displayArquivo.aspx?conteudo=n3Kn9%20YZNak=

  • The zip of schemes I downloaded has 20 xsd files. Should I generate my class from all of them? If not, what are the correct ones? And how do I know the right order? When I run the command to generate the class from all XSD, it tries to create a file whose name is the name of all the concatenated files, then it gives an error, that the file name is too big to be generated.

  • Try this file: http://www.nfe.fazenda.gov.br/portal/displayArquivo.aspx?conteudo=BALgvpK9Jvo= XML Schemas NF-e - Release Package No. 9 (New NF-e layout, NT 2016.002 v.1.40) (24/10/2017) (ZIP)

  • 1

    xsd.exe nfe_v4.00.xsd xmldsig-core-schema_v1.01.xsd /c /edb

Show 1 more comment

3

I used the https://xsd2code.codeplex.com/ an addon pro visual studio. Once installed, just right click on the xsd (inside the Solution explorer) and then on Run Xsd2Code Generation.

  • works only in visual studio 2010 and 2013 version

Browser other questions tagged

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