Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Question: Use at build time? #518

Closed
M-Schiller opened this issue Jun 24, 2024 · 1 comment
Closed

Question: Use at build time? #518

M-Schiller opened this issue Jun 24, 2024 · 1 comment

Comments

@M-Schiller
Copy link

Thank you for creating this amazing tool and apologies for posting a question here, but I could not find a guide to or usage of what I would like to have in a project I am developing.

Currently, I use a version of XmlSchemaClassGenerator.Console that I need to check into a repository (under tools\..) and use in my project as

  <Target Name="Create classes from schema" BeforeTargets="PreBuildEvent" AfterTargets="Clean">
      <Message Importance="high" Text="Running batch script..." />
      <Exec Command=".\tools\xscgen\XmlSchemaClassGenerator.Console.exe .\data\MySchema.xsd" />
  </Target>

What I am trying to achieve is a way of handling this via the NuGet package and without having to install the dotnet tool (if possible) so that I can also use the functionality in a build pipeline that does not have any tools installed.

@mganss
Copy link
Owner

mganss commented Jun 24, 2024

I think the easiest way is to use xscgen as a local tool.

Another option of course is to use the XmlSchemaClassGenerator library in a custom console app that can be part of your solution. This may sound harder than it is, should be only a few lines.

In #281 @shuebner started an effort to create a source generator which would probably be ideal for your use case, but unfortunately it has stalled.

Repository owner locked and limited conversation to collaborators Jun 24, 2024
@mganss mganss converted this issue into discussion #519 Jun 24, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants