Hello,
I have a web application where I am doing alot of the work in a separate
namespace that isn't part of a web page. I would like to be able to trace
into this section of code, but because it's not a 'Page' object the
Page.Trace isn't doable. Does anyone have any suggestions as to how I can
implement tracing in this separate code? Writing to an output file isn't
doable either because our customers will not allow write access to the disk
drive. Any suggestions? Thanks! 2 1200
Richard,
You can access the trace yourself. Basically, set a reference to
System.Web.dll, and use the HttpContext class. The static property Current
will give you the current context, and then you can access the Trace
property on that to write to it.
Of course, your app should do nothing if the context is null (in the way
of tracing).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Richard" <ab*******@mind spring.com> wrote in message
news:e%******** ********@tk2msf tngp13.phx.gbl. .. Hello,
I have a web application where I am doing alot of the work in a separate namespace that isn't part of a web page. I would like to be able to trace into this section of code, but because it's not a 'Page' object the Page.Trace isn't doable. Does anyone have any suggestions as to how I can implement tracing in this separate code? Writing to an output file isn't doable either because our customers will not allow write access to the disk drive. Any suggestions? Thanks!
Thanks Nicholas, that worked perfectly!
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:%2******** *******@TK2MSFT NGP11.phx.gbl.. . Richard,
You can access the trace yourself. Basically, set a reference to System.Web.dll, and use the HttpContext class. The static property
Current will give you the current context, and then you can access the Trace property on that to write to it.
Of course, your app should do nothing if the context is null (in the
way of tracing).
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard. caspershouse.co m
"Richard" <ab*******@mind spring.com> wrote in message news:e%******** ********@tk2msf tngp13.phx.gbl. .. Hello,
I have a web application where I am doing alot of the work in a separate namespace that isn't part of a web page. I would like to be able to
trace into this section of code, but because it's not a 'Page' object the Page.Trace isn't doable. Does anyone have any suggestions as to how I
can implement tracing in this separate code? Writing to an output file
isn't doable either because our customers will not allow write access to the disk drive. Any suggestions? Thanks!
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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.
|
by: Paul Ibison |
last post by:
HI
when I have a page which calls a component I want to do the following -
tracing set to false on the pag
tracing set to true in the componen
tracing set to false in the page after the call to the component. This is so any further tracing calls are ignored
However, I find that there are no tracing results. Can I do this sort of thing - perhaps I am missing something
Regards
Paul Ibiso
|
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
|
by: serge calderara |
last post by:
Dear all,
I have an applicatin that generate a querry to an SQL server, then display
results on a second webform.
I try to see how tracing works, then I have notice that as soon as I
implement tracing on the page, when I click on the BACK button of explorer I
get a warning message that information of the page needs to be resend to be
displayed ?
|
by: deepukutty |
last post by:
Hi all,
I know tht we can do tracing in two ways.one in application level and the
other is at Page level.
I am able to see the details of trace either on the page itself or
.../trace.axd page.
I want to use maximum out of the available trace details .
or
let me put it like this....
tell me the actual scenario's where these trace details will be use ful and
| |
by: asapjim |
last post by:
Hi, I have a C# class that is being used by an ASP.net application. How can
I include the tracing from the class in the ASP.net application's trace
output (trace.axd)?
|
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:
|
by: GB |
last post by:
All,
There's a few messages around about the Environment.GetResourceString
causing a "Resource lookup failed - infinite recursion detected." error
but nothing detailed.
I have a problem whereby I am changing the thread Culture Info from
default (English) to a custom culture object (Welsh) in a .NET 1.1 ASPX
page.
|
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.
...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
| |
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...
|
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...
|
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();...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |