XML Dataset Code Gen Internal Constructors

S

Steven Nagy

Hey All,

I have written a tool that generates XML for a dataset.
You know when you add a dataset file to a project, you write the XML
and the code gets generated automatically? Well I want this sitting in
a seperate DLL project.
However, the code generated by VS specifies a constructor that is
INTERNAL.

Is it possible to either tell VS that the generated code should have
public constructors, or perhaps to specify somewhere in the XML to tell

it to make them public?

I don't want move the dataset into the main project if i don't have to.

Essentially it prevents the dataset from being reusable across
projects. This is bad for me.

Any help is greatly appreciated.

Cheers,
Steven
 
G

Guest

Steven,
I don't know exactly what your business logic scenario is, but you could try
using XSD.EXE to generate the dataset which would give you the source code
that you can easily modify. Also, there is a tool called XSDObjectGen and a
similar tool from MVP Daniel Cazzulino et al (which name I've forgotten) that
will do the same but offer even more customizations. Finally there is an
open -source tool on Sourceforge.net called "dingo" that is even one step
more sophisticated.
Peter
 
S

Steven Nagy

Thanks for the reply Peter.

I know that I can customise the code that is generated from XSD.EXE but
the problem is that in half a day I might regenerate the code again,
which means those constructor changes are lost.
So I am wondering if there is a way to specify in the XML (XSD) view,
the constructor accessor. Changing the constructors for 50+ classes
everytime.

The third party tools are an option but because I don't actually
manually call XSD.EXE, I would l prefer to keep it all internal to VS.
All I am doing is updating the XSD in the XML view of a dataset schema,
which of course then generates the code upon save.

Do you know if there is any specification on how the XSD creates the
code in XSD.EXE from microsoft?

Many thanks,
Steven Nagy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top