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

Can't get Trace to work when used in .cs class

I can get the Trace.Write() to work if I put the code in
an aspx.cs file. But, I have a (C#) class called by my
aspx.cs code that also has Trace messages, but none of
them show up in the Trace file, Trace.axd. Does anyone
know why?

Thanks.

Nov 17 '05 #1
6 1708
Make sure you've got "using System.Diagnostics;" referenced in your cs file
"Joe Rattz" <jo*******@genpt.com> wrote in message
news:05****************************@phx.gbl...
I can get the Trace.Write() to work if I put the code in
an aspx.cs file. But, I have a (C#) class called by my
aspx.cs code that also has Trace messages, but none of
them show up in the Trace file, Trace.axd. Does anyone
know why?

Thanks.

Nov 17 '05 #2
I have. It wouldn't even compile without that.
-----Original Message-----
Make sure you've got "using System.Diagnostics;" referenced in your cs file

"Joe Rattz" <jo*******@genpt.com> wrote in message
news:05****************************@phx.gbl...
I can get the Trace.Write() to work if I put the code in
an aspx.cs file. But, I have a (C#) class called by my
aspx.cs code that also has Trace messages, but none of
them show up in the Trace file, Trace.axd. Does anyone
know why?

Thanks.

.

Nov 17 '05 #3
"Joe Rattz" <jo*******@genpt.com> wrote in message
news:05****************************@phx.gbl...
I can get the Trace.Write() to work if I put the code in
an aspx.cs file. But, I have a (C#) class called by my
aspx.cs code that also has Trace messages, but none of
them show up in the Trace file, Trace.axd. Does anyone
know why?


Probably because your .cs file is using System.Diagnostics.Trace.Write?

Try passing the Page.Trace object to your methods in the C# class.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
Nov 17 '05 #4
"Joe Rattz" <jo*******@genpt.com> wrote in message
news:05****************************@phx.gbl...
I can get the Trace.Write() to work if I put the code in
an aspx.cs file. But, I have a (C#) class called by my
aspx.cs code that also has Trace messages, but none of
them show up in the Trace file, Trace.axd. Does anyone
know why?


Probably because your .cs file is using System.Diagnostics.Trace.Write?

Try passing the Page.Trace object to your methods in the C# class.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
Nov 17 '05 #5
>Probably because your .cs file is using
System.Diagnostics.Trace.Write?

Yes, it is. Well, where is it writing the trace at? It
doesn't throw an exception so it must be a legitimate
Trace object, correct? So, why should I need to pass it?
-----Original Message-----
"Joe Rattz" <jo*******@genpt.com> wrote in message
news:05****************************@phx.gbl...
I can get the Trace.Write() to work if I put the code in
an aspx.cs file. But, I have a (C#) class called by my
aspx.cs code that also has Trace messages, but none of
them show up in the Trace file, Trace.axd. Does anyone
know why?
Probably because your .cs file is using

System.Diagnostics.Trace.Write?
Try passing the Page.Trace object to your methods in the C# class.--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
.

Nov 17 '05 #6
>Probably because your .cs file is using
System.Diagnostics.Trace.Write?

Yes, it is. Well, where is it writing the trace at? It
doesn't throw an exception so it must be a legitimate
Trace object, correct? So, why should I need to pass it?
-----Original Message-----
"Joe Rattz" <jo*******@genpt.com> wrote in message
news:05****************************@phx.gbl...
I can get the Trace.Write() to work if I put the code in
an aspx.cs file. But, I have a (C#) class called by my
aspx.cs code that also has Trace messages, but none of
them show up in the Trace file, Trace.axd. Does anyone
know why?
Probably because your .cs file is using

System.Diagnostics.Trace.Write?
Try passing the Page.Trace object to your methods in the C# class.--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
.

Nov 17 '05 #7

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

Similar topics

3
by: fdsl ysnh | last post by:
--- python-list-request@python.orgдµÀ: > Send Python-list mailing list submissions to > python-list@python.org > > To subscribe or unsubscribe via the World Wide Web, > visit >...
8
by: Geopsaros | last post by:
Hi! I have created a custom trace Listener class, called "DBTraceListener" it works fine when i add it manually in code : (eg. Trace.listeners.add(new DBTraceListener("myDBListener",...
11
by: Ken Varn | last post by:
I want to be able to determine my current line, file, and function in my C# application. I know that C++ has the __LINE__, __FUNCTION__, and __FILE___ macros for getting this, but I cannot find a...
2
by: Richard | last post by:
Hi, I'm having trouble setting up a config file based trace switch & listener. I added an application config file to my console based C# program using the "Add New Application Config File" button...
25
by: Zeng | last post by:
I finally narrowed down my code to this situation, quite a few (not all) of my CMyClass objects got hold up after each run of this function via the simple webpage that shows NumberEd editbox. My...
1
by: Martin | last post by:
Hi, is it a wise thing to do to place trace listeners (that write to a text file) into an asp.net application. I wish to do this for testing so that a user may vist as many different pages as...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
2
by: tshad | last post by:
I have a page with Trace.Warns statements in my Page_Load and functions that it calls, but it doesn't seem to work in a class that is defined on the same page. I am writing this in C# I am...
10
by: DoB | last post by:
As in the subject... What is an overhead cost conneted with using the /d:TRACE switch? The Trace class is a convenient and configurable logger, but it requires the executable to be built with...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.