473,413 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Web.config with multiple schemas

Hi,
What I'm trying to do is:

- To write a Web.config with custom sections. (Done)
- To write a xsd schema for this custom sections.(Done)
- Tell the Web.config to take the two schemas.

When i specify the two schemas in the schemas property of the
web.config, it seems that only one is token.

For now, what i found is to add a line in the DotnetConfig.xsd
<xs:include schemaLocation="MyCustomSchema.xsd" />

Aren't they anyway to not modify the DotnetConfig.xsd, but instead,
to modify the customschema??

Greetz,
Sami
Mar 29 '06 #1
3 4608
Hi Sami,

You need to declare a namespace in your "MyCustomSchema.xsd". The XML
Editor does not support having two schemas with the same namespace listed in
the schemas property - in your case you have two schemas with no
targetNamespace.

--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Sami Marzouki" <Sa***********@alsico.be> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi,
What I'm trying to do is:

- To write a Web.config with custom sections. (Done)
- To write a xsd schema for this custom sections.(Done)
- Tell the Web.config to take the two schemas.

When i specify the two schemas in the schemas property of the web.config,
it seems that only one is token.

For now, what i found is to add a line in the DotnetConfig.xsd
<xs:include schemaLocation="MyCustomSchema.xsd" />

Aren't they anyway to not modify the DotnetConfig.xsd, but instead,
to modify the customschema??

Greetz,
Sami

Mar 29 '06 #2
Hi Stan,
Thx for your answer:

So if i did wel understand you:
so must look like:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
targetNamespace="http://berco.com/webservices/WebConfig"
xmlns="http://berco.com/webservices/WebConfig">
I have another question:

in my Web.config , i have put my custom sections into configuration
section like this:

Web.Config
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<section name="CDAF.COMMON" type="System.Configuration.SingleTagSectionHandler "/>
<section name="CDAF.DATABASE" type="CDAF.Configuration.clsConfigurationHandler,C DAF.Configuration"/>
<section name="CDAF.EVENTLOG" type="CDAF.Configuration.clsConfigurationHandler,C DAF.Configuration"/>
<section name="CDAF.USERINTERFACE" type="CDAF.Configuration.clsConfigurationHandler, CDAF.Configuration"/>
<section name="CDAF.HELP" type="CDAF.Configuration.clsConfigurationHandler, CDAF.Configuration"/>
<section name="CDAF.HOTKEY" type="CDAF.Configuration.clsConfigurationHandler, CDAF.Configuration"/>
<section name="CDAF.REMOTEOBJECT" type="CDAF.Configuration.clsConfigurationHandler, CDAF.Configuration"/>
</configSections>
<CDAF.COMMON
SingleElement.ACO.WebEnabled="False"
EventLogs.ACO.WebEnabled="True"
Application.Database.Cache.ACO.WebEnabled="True"
UserInterface.ACO.WebEnabled="True"
Help.ACO.WebEnabled="False"
HotKey.ACO.WebEnabled="True"
RemoteObject.ACO.WebEnabled="True"
/>
But, the intellisense won't give my custom sections in configuration
section, i mean, that i must be out <configuration> section to see my
sections in intellisense.
Stan Kitsis [MSFT] wrote: Hi Sami,

You need to declare a namespace in your "MyCustomSchema.xsd". The XML
Editor does not support having two schemas with the same namespace listed in
the schemas property - in your case you have two schemas with no
targetNamespace.

Mar 30 '06 #3
Hi Sami,

Once you've added a target namespace to your schema, you'll also need to
declare it in the instance document:

<configuration xmlns:myNS="http://berco.com/webservices/WebConfig">
</configuration>

When you do this, you'll get intellisense for your own namespace under
configuration section. This complication is related to the fact that
configuration element has xs:any as a child. This will be changed in the
next release so that you don't have to declare the namespace in your XML,
but for now you have to do it.
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Sami Marzouki" <Sa***********@alsico.be> wrote in message
news:Ok**************@tk2msftngp13.phx.gbl...
Hi Stan,
Thx for your answer:

So if i did wel understand you:
so must look like:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
targetNamespace="http://berco.com/webservices/WebConfig"
xmlns="http://berco.com/webservices/WebConfig">


I have another question:

in my Web.config , i have put my custom sections into configuration
section like this:

Web.Config
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the web
admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config -->
<configuration>
<configSections>
<section name="CDAF.COMMON"
type="System.Configuration.SingleTagSectionHandler "/>
<section name="CDAF.DATABASE"
type="CDAF.Configuration.clsConfigurationHandler,C DAF.Configuration"/>
<section name="CDAF.EVENTLOG"
type="CDAF.Configuration.clsConfigurationHandler,C DAF.Configuration"/>
<section name="CDAF.USERINTERFACE"
type="CDAF.Configuration.clsConfigurationHandler, CDAF.Configuration"/>
<section name="CDAF.HELP"
type="CDAF.Configuration.clsConfigurationHandler, CDAF.Configuration"/>
<section name="CDAF.HOTKEY"
type="CDAF.Configuration.clsConfigurationHandler, CDAF.Configuration"/>
<section name="CDAF.REMOTEOBJECT"
type="CDAF.Configuration.clsConfigurationHandler, CDAF.Configuration"/>
</configSections>
<CDAF.COMMON
SingleElement.ACO.WebEnabled="False"
EventLogs.ACO.WebEnabled="True"
Application.Database.Cache.ACO.WebEnabled="True"
UserInterface.ACO.WebEnabled="True"
Help.ACO.WebEnabled="False"
HotKey.ACO.WebEnabled="True"
RemoteObject.ACO.WebEnabled="True"
/>


But, the intellisense won't give my custom sections in configuration
section, i mean, that i must be out <configuration> section to see my
sections in intellisense.
Stan Kitsis [MSFT] wrote:
Hi Sami,

You need to declare a namespace in your "MyCustomSchema.xsd". The XML
Editor does not support having two schemas with the same namespace listed
in the schemas property - in your case you have two schemas with no
targetNamespace.

Mar 30 '06 #4

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

Similar topics

26
by: S. Justin Gengo | last post by:
I installed the release of Visual Studio.NET 2005 Professional a few days ago. I've been using the Beta for a few weeks and one immediate problem is that I don't seem to have full intellisense in...
5
by: Jeff | last post by:
We are using .Net and the wsdl Utility to generate proxies to consume web services built using the BEA toolset. The data architects on the BEA side create XML schemas with various entities in...
3
by: Chris Baker | last post by:
This is a problem I have been troubleshooting for about 4-6 months. I have an e-mail form on a client's public website that is mis-behaving. It is written in ASP and uses a CDO.Message object. ...
5
by: Rachel | last post by:
Hi, I currently have several sections pointing to various custom providers inside my Web.conf file. I get multiple messages about not being able to find schema information. ("Could not find...
0
by: vihrao | last post by:
I am designing wsdl that uses multiple schemas. I can do this in two ways: 1) use multiple schema imports in one wsdl or 2) use multiple schema imports in to one common schema and then import a...
5
by: paul_zaoldyeck | last post by:
does anyone know how to validate an xml file against multiple defined schema? can you show me some examples? i'm making here an xml reader.. thank you
13
by: Jonny Bergdahl | last post by:
I have a ASP.Net 2.0 web application that I am trying to debug. Problem is that I can't get the error message to show in the browser. It always returns the generic error message telling me to set...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.