473,804 Members | 3,330 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSD Includes in App_Code

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:includeele ment 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

Aug 11 '07 #1
0 1364

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1897
by: AZ | last post by:
During the Pre-compile process of an ASP.Net 2.0 app, it compiles the code-behind & optionally the presentation files into an assembly named App_Code.dll. Can that not be renamed to a more project friendly name, such as ProjectName.dll or something. I didnt see any parameters to be able to choose the output assembly name.
11
29895
by: Steve Franks | last post by:
I'm using VS.NET 2005 Beta 2. I have a helper C# class I wrote that I placed in my /App_Code directory. Everything runs fine locally. However when I use the "Copy Web" function to upload the site to the production server, I get the following error when trying to run the page on production: "System.Web.HttpException: The directory '/App_Code' is not allowed because the application is precompiled." Anyone know this works fine locally but...
5
6096
by: Jay Douglas | last post by:
I have a set of pages that inherit from a base class in the App_Code folder. The class looks something like: public class MyBaseClass : System.Web.UI.Page In various stages of the life cycle I need to add user controls to the page control container. i.e: protected override void OnInit(EventArgs e) {
2
3205
by: walter | last post by:
Hi, when I add a new page in my asp.net 2 project and put some controls there, everything works fine until I move the code behind into App_Code folder.--When I compile , it tells me that control "not exist in the current context". I thought putting code behind in App_Code folder is the recommendation for asp.net 2. In order to do so, I just simply remove the codefile attribute in @page. Maybe my perception of putting all code in...
4
4795
by: Martin Simard | last post by:
Hi all, Is there a way to rename the App_Code.dll generated from the code that belongs to the App_Code folder? We are developping several web applications that we are merging in a single application on our production server. This works great with the new compilation model of .NET 2.0, but we have to create a class library for each web application to have a unique .dll for each app. Each class library has a unique name since it...
3
3099
by: Howard | last post by:
I have two websites that basically use the same data access layer. the code in the app_code folder are identical for these two website. Each has a different presentation layer (html stuff). It's a lot of work keeping the two up to date when making changes in the data access layer. Im wondering if there is a way to let two websites share the same app_code or something to that effect. Has anyone done this Is this even possible? If so how do...
2
14593
by: pradeep_TP | last post by:
Hello, I am trying to use APP_CODE folder for all my class files under VS 2005. After adding APP_CODE in the solution explorer, I added a new web page by right clicking project and selecting add new item. I expected the code behind file (Default.aspx.cs) to automatically go under APP_CODE folder, but it didnt. I tried to drag and drop the code behind file into the APP_CODE folder. I also changed the page directive to the following: ...
9
2857
by: rn5a | last post by:
Is putting a VB class file in the special directory named App_Code the same as relocating the VB class file from the App_Code directory to another directory & then using the VBC tool, compiling the VB class file into a DLL & putting the DLL in the bin directory? Though while running an ASP.NET app using either of the 2 approaches doesn't make any difference, Visual Web Developer 2005 Express Edition behaves erratically sometimes if the...
5
3011
by: Randy | last post by:
I've converted a VS 2003 project to VS 2005. I have one utility class that it put in the APP_CODE directory. When I try and compile I'm getting this error... Error 1 The type or namespace name 'WelcomeToPFP' could not be found (are you missing a using directive or an assembly reference?) C:\Inetpub\wwwroot\PFPApp\App_Code\Utils.cs 19 9 WelcomeToPFP is a class defined in the root directory of the solution. My question is...I'm drawing a...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.