473,408 Members | 2,813 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,408 software developers and data experts.

System.Diagnostics.Switches ASP.NET 2.0

Has there been a change in behaviour of switches between 1.1 and 2.0.

I have a web site that defines a switch and then an application that adds
the same switch but with a different value. Under 1.1, this worked and only
my sub-application reported values against the switch.

Under 2.0 I get a runtime error saying that the switch has already been
defined - is this expected behaviour?

Paul
May 20 '06 #1
2 1818
Hi Paul,

Thank you for posting.

As for the System.Diagnostics Switch setting, it does has changed from .net
framework 1.1 to .net framework 2.0. In 1.1, even the folloing
configuration setting can work (without exception) and the runtime will
take the first one's value:

=====================
<system.diagnostics>
<switches>
<add name="XmlSerialization.Compilation" value="4"/>
<add name="XmlSerialization.Compilation" value="6"/>
</switches>
</system.diagnostics>
=====================

However, this is not allowed in .net framework 2.0. I have no idea of the
exact code logic however, based on my debugging, it is the
configurationRecord method of the
System.Configuration.BaseConfigurationRecord that throughs the error. And
seems 2.0 's config file parser will force us to only define a certain
switch instance(by name) once through the whole configuration
hierarchy(from machine level to application or sub app level). Therefore,
for your scenario, if you want to override a certain switch with new value,
you can first use <remove> element to remove the former definition and add
a new one. Just like:

=======================

<system.diagnostics>
<switches>
<add name="XmlSerialization.Compilation" value="4"/>

<remove name="XmlSerialization.Compilation"/>

<add name="XmlSerialization.Compilation" value="5"/>
</switches>
</system.diagnostics>
================================

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
May 22 '06 #2
Hi Paul,

How are you doing on this issue or does the info in my last reply helps you
a little? If there is still anything we can help, please feel free to post
here.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

May 24 '06 #3

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

Similar topics

7
by: rahul8143 | last post by:
hello, what is difference between system call and library function call? Does library function call can have context switch to kernel mode? regards, rahul
5
by: David Conorozzo | last post by:
I am able to create new sources using CreateEventSource. I can call GetEventLogs, I can delete sources, I can see if sources exist BUT, as soon as I try a "WriteEntry", I get an exception: ...
4
by: Jiho Han | last post by:
I have the following defined in web.config under <configuration> node: <system.diagnostics> <switches> <add name="MainSwitch" value="4"/> </switches>
1
by: Patrick | last post by:
When Tracing in ASP.NET, the IIS process (on IIs5.1) is locking on the Trace file, and I can't read the trace file without restarting the IIS: Even the following does NOT work (how could I fix...
1
by: Ashkan Daie | last post by:
Hi All, When trying to install a performance counter via InstallUtil I get the following exception: Creating performance counter category Enterprise Library Caching. An exception occurred...
3
by: Juhan | last post by:
Hi! I have a strange error in a console application that is hosted by IIS 5.0 and invokes a web service hosted on the same machine. A request form the web comes in and it is dispatched to a...
1
by: Oleg Ogurok | last post by:
Hi there, My ASP.NET 2.0 app uses an external assembly that calls methods like Trace.Write() and Trace.TraceError() of namespace System.Diagnostics. I need to enable tracing in my web app so...
0
by: jammendolia | last post by:
Hello all, I am having an intermittent exception occur when writing the the eventlog from a windows service application written in c#, running on a Win2k SP4 server. Here's the code: ...
2
by: =?Utf-8?B?c2FtMDFt?= | last post by:
I have a remoting application that was developed on a Windows XP SP2 machine with VS2005 SP1. I finally got everything deployed using Wix 3.0, and it works great. Problem is, when I install the msi...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.