473,799 Members | 3,084 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tracing and Web.Config

I cannot get a clean compile if I add Trace configuration info into my
web.config. This generates an error:

<configuratio n>
<system.diagnos tics>
<switches>
<add name="MyTraceSw itch" value="4" />
</switches>
<trace autoflush="fals e" indentsize="4">
<listeners>
<add name="TextListe ner"
type="System.Di agnostics.TextW riterTraceListe ner" initializeData= "c:\my.log"
/>
<remove type="System.Di agnostics.Defau ltTraceListener " />
</listeners>
</trace>
</system.diagnost ics>
<configuratio n>

If i remove the Trace section but leave in the TraceSwitch part like:

<configuratio n>
<system.diagnos tics>
<switches>
<add name="MyTraceSw itch" value="4" />
</switches>
</system.diagnost ics>
<configuratio n>

the app compiles but when I use the code:

TraceSwitch MyTraceSwitch = new TraceSwitch("My TraceSwitch","M y Web Service");

then check the value of MyTraceSwitch.T raceLevel it's off like the
web.config was ignored.

Any suggestions on how to correct this?
Nov 19 '05 #1
3 2781
What's the error generated?

-Brock
DevelopMentor
http://staff.develop.com/ballen
I cannot get a clean compile if I add Trace configuration info into my
web.config. This generates an error:

<configuratio n>
<system.diagnos tics>
<switches>
<add name="MyTraceSw itch" value="4" />
</switches>
<trace autoflush="fals e" indentsize="4">
<listeners>
<add name="TextListe ner"
type="System.Di agnostics.TextW riterTraceListe ner"
initializeData= "c:\my.log"
/>
<remove type="System.Di agnostics.Defau ltTraceListener " />
</listeners>
</trace>
</system.diagnost ics>
<configuratio n>
If i remove the Trace section but leave in the TraceSwitch part like:

<configuratio n>
<system.diagnos tics>
<switches>
<add name="MyTraceSw itch" value="4" />
</switches>
</system.diagnost ics>
<configuratio n>
the app compiles but when I use the code:

TraceSwitch MyTraceSwitch = new TraceSwitch("My TraceSwitch","M y Web
Service");

then check the value of MyTraceSwitch.T raceLevel it's off like the
web.config was ignored.

Any suggestions on how to correct this?


Nov 19 '05 #2
Just the generic "i dont like your web.config" error.

Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: Exception in configuration section handler.

Source Error:

Line 16: <add key="LogDirecto ryName" value="\logs" />
Line 17: </appSettings>
Line 18: <system.diagnos tics>
Line 19: <switches>
Line 20: <add name="MyTraceSw itch" value="4" />

"Brock Allen" wrote:
What's the error generated?

-Brock
DevelopMentor
http://staff.develop.com/ballen
I cannot get a clean compile if I add Trace configuration info into my
web.config. This generates an error:

<configuratio n>
<system.diagnos tics>
<switches>
<add name="MyTraceSw itch" value="4" />
</switches>
<trace autoflush="fals e" indentsize="4">
<listeners>
<add name="TextListe ner"
type="System.Di agnostics.TextW riterTraceListe ner"
initializeData= "c:\my.log"
/>
<remove type="System.Di agnostics.Defau ltTraceListener " />
</listeners>
</trace>
</system.diagnost ics>
<configuratio n>
If i remove the Trace section but leave in the TraceSwitch part like:

<configuratio n>
<system.diagnos tics>
<switches>
<add name="MyTraceSw itch" value="4" />
</switches>
</system.diagnost ics>
<configuratio n>
the app compiles but when I use the code:

TraceSwitch MyTraceSwitch = new TraceSwitch("My TraceSwitch","M y Web
Service");

then check the value of MyTraceSwitch.T raceLevel it's off like the
web.config was ignored.

Any suggestions on how to correct this?


Nov 19 '05 #3
I am new in .NET but I am currently at a chapter on Debugging and in the
example the TraceSwitch variable is declared as static, i.e.

static TraceSwitch MyTraceSwitch = new TraceSwitch("My TraceSwitch", "My Web
Service");

The book is on Windows based applications and so this may not be of any help
but thought I would make the suggestion anyway.

"Shawn Melton" wrote:
Just the generic "i dont like your web.config" error.

Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: Exception in configuration section handler.

Source Error:

Line 16: <add key="LogDirecto ryName" value="\logs" />
Line 17: </appSettings>
Line 18: <system.diagnos tics>
Line 19: <switches>
Line 20: <add name="MyTraceSw itch" value="4" />

"Brock Allen" wrote:
What's the error generated?

-Brock
DevelopMentor
http://staff.develop.com/ballen
I cannot get a clean compile if I add Trace configuration info into my
web.config. This generates an error:

<configuratio n>
<system.diagnos tics>
<switches>
<add name="MyTraceSw itch" value="4" />
</switches>
<trace autoflush="fals e" indentsize="4">
<listeners>
<add name="TextListe ner"
type="System.Di agnostics.TextW riterTraceListe ner"
initializeData= "c:\my.log"
/>
<remove type="System.Di agnostics.Defau ltTraceListener " />
</listeners>
</trace>
</system.diagnost ics>
<configuratio n>
If i remove the Trace section but leave in the TraceSwitch part like:

<configuratio n>
<system.diagnos tics>
<switches>
<add name="MyTraceSw itch" value="4" />
</switches>
</system.diagnost ics>
<configuratio n>
the app compiles but when I use the code:

TraceSwitch MyTraceSwitch = new TraceSwitch("My TraceSwitch","M y Web
Service");

then check the value of MyTraceSwitch.T raceLevel it's off like the
web.config was ignored.

Any suggestions on how to correct this?


Nov 19 '05 #4

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

Similar topics

2
1701
by: Trace User | last post by:
Hello, I have a design question regarding Tracing and Trace Switches. I understand that Trace Switches can be configured through an application's .config file. When a switch is instantiated, the application automatically checks the configuration file for a matching named switch. If there's a match, the configuration parameters are set.
3
9512
by: Daniel Billingsley | last post by:
The documentation on this subject seems to give you 98% of what you need to know. From various sources, I have compiled an understanding that this should work: <configuration> <system.diagnostics> <switches> <add name="clientswitch" value="3" /> </switches> <trace autoflush="true" indentsize="0">
5
1592
by: Dabbler | last post by:
When I first start up an ASP.NET application with tracing enabled in web.config the first few pages show trace at bottom of the page but then at some point the pages return to normal with no trace information displayed. Can anyone tell me what might be causing the Trace to turn off? Thanks for any help with this ..NET 1.1 running on localhost
2
1262
by: Dmitry Bond. | last post by:
Hello All. Could you plase help me to configure tracing in Asp.Net application. I use Win2ksp4, .Net 1.1 (+ all latest patches for .Net 1.1 an for Windows). I faced with stable error. On first access to the site it said: ===quote:begin=== Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your...
0
956
by: Lenn | last post by:
Can I add my own TextWriterTraceListener listeners in ASP.NET (web service) application. I have the following in web.config file: <system.diagnostics> <trace autoflush="true" indentsize="4"> <listeners> <!-- remove comment to enable logging --> <add name="LogFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\Log\ws.log" />
0
1367
by: cnys | last post by:
We have an ASP.NET 2.0 (C#) app and we're trying to add tracing into it. The tracing functionality within .NET is great, but when we output this to a file, it's kind of sparse. So, we're looking for ideas on how to get more tracing info. output to our log file than what's currently output by calling the Write methods. Here are some snippets of what we're thinking of:
0
1341
by: rehto | last post by:
We have an ASP.NET 2.0 (C#) app and we want to enable tracing (see the code snippets below). The first time a user navigates to the app., the tracing works fine (the ASP.NET tracing appears on the screen and writes to a text file). The problem happens any subsequent time the app. is used--tracing doesn't happen. It's as if tracing just turns itself off. So, we only get tracing on the first time the app runs but never any other time. ...
2
1263
by: bonk | last post by:
I am using .NET 2.0 tracing to log messages within my application and app.config (<System.Diagnostics>) to configure it. I would like to be able to configure tracing in a finer grained manner than it is currently possibile out of the box. Especially I would like 1. the filnames where the traceevent end up to be dynamically generated (e.g. based on date and the tracesource). This should be configurable somewhere in the app.config by...
0
1077
by: =?Utf-8?B?Y2FsZGVyYXJh?= | last post by:
Dear all, Is there a way to read the <System.Diagnosticcontent from a condif file other than the App.config ? For example I have an assembly.dll which has is own config file named Assembly.dll.config in which I have connection string. I can read those entries throught the ConfigurationManager class in .NEt 2.0 Can I do the same thing to get entries for tracing ?
1
1720
by: RedLars | last post by:
Hi Does the class System.Diagnostics.Trace use a singelton ? I'm able to do this; System.Diagnostics.Trace.WriteLine("test"); However, these give compiler errors; System.Diagnostics.Trace myTrace = new System.Diagnostics.Trace; // A new expression requires () or
0
9685
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
10473
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...
0
10249
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10219
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
10025
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
9068
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...
1
7563
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6804
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.