Hello everyone,
I've been trying to have increasingly complex XSD Schemas in the
App_Code folder of my application, but it seems that I cannot easily
use the <xsd:includeelement to have any sort of structure.
First I was getting a 'Type not defined' error, which after
investigating was just because the includes were being ignored. This
turned out to be because the 'schemaLocation' attribute could not be
used to reference other files as if they were in the same directory
(I'm guessing this has something to do with how App_Code class
builders work; it looks as if they work on each file in isolation).
The first thing that worked was using a URL for 'schemaLocation',
which worked as long as the included XSD files were *outside* the
App_Code directory. That means that if they were to be updated, no
recompiling would be done, which kind of defeats the purpose of the
whole thing.
If they were in it, there are two problems: First, if the common files
were included several times by different XSD files, the types in them
would also be defined multiple times, resulting in 'already defined'
compilation errors. Also they would have been compiled themselves,
since they too are XSD files. I can deal with that with a few tricks
(not described for the sake of brevity) , but the second problem is
that you cannot reference App_Code stuff in a URL since it's a hidden
segment. If I open it up (which I think it's possible), that's a whole
can of worms altogether.
Does anyone have a simple and elegant way to do this? I don't want to
go into using hacks, but things like custom web.configs or file system
watchers seems almost inevitable for this to work. I would be indebted
to anyone with a solution.
Thank you,
Alexis