Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing parameter in example code for code generation from xsd #42634

Closed
IdatBuschmann opened this issue Sep 17, 2024 · 1 comment · Fixed by #42685
Closed

Missing parameter in example code for code generation from xsd #42634

IdatBuschmann opened this issue Sep 17, 2024 · 1 comment · Fixed by #42685
Labels
dotnet-fundamentals/svc in-pr This issue will be closed (fixed) by an active pull request. Pri2 ⌚ Not Triaged Not triaged

Comments

@IdatBuschmann
Copy link

Type of issue

Code doesn't work

Description

Under the header "To generate classes that conform to a specific schema", step 2, the console code example is
xsd mySchema.xsd
This generates an error message: "Error: Can only generate one of classes or datasets."

The correct call to generate the classes for the schema is
xsd mySchema.xsd /c

Page URL

https://learn.microsoft.com/en-us/dotnet/standard/serialization/xml-schema-def-tool-gen

Content source URL

https://github.com/dotnet/docs/blob/main/docs/standard/serialization/xml-schema-def-tool-gen.md

Document Version Independent Id

77c8e5c2-62e7-a5f7-5b3e-bc7bb7ce8691

Article author

@gewarren

Metadata

  • ID: c09c6ce9-09c1-e543-4efd-f01dba75e1cb
  • Service: dotnet-fundamentals
@BartoszKlonowski
Copy link
Contributor

Indeed, even the help of the xsd.exe says:

xsd.exe -
    Utility to generate schema or class files from given source.

xsd.exe <schema>.xsd /classes|dataset [/e:] [/l:] [/n:] [/o:] [/s] [/uri:]
xsd.exe <assembly>.dll|.exe [/outputdir:] [/type: [...]]
xsd.exe <instance>.xml [/outputdir:]
xsd.exe <schema>.xdr [/outputdir:]

     - OPTIONS -

/classes
    Generate classes for this schema. Short form is '/c'.

Although I don't think that this page says strictly about the classes only, but other "XML Schema Documents" as well, I still believe an additional sentence would be good to have there to emphasize about the options and what to pass to generate mentioned classes, for instance.

I will handle that addition.

@dotnet-policy-service dotnet-policy-service bot added the in-pr This issue will be closed (fixed) by an active pull request. label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-fundamentals/svc in-pr This issue will be closed (fixed) by an active pull request. Pri2 ⌚ Not Triaged Not triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@dotnet-bot @BartoszKlonowski @IdatBuschmann and others