473,320 Members | 2,189 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.

compiling webservice using csc.exe

if i build using visual studio no problem everything works great.

if i use csc.exe to compile webservice, and everything works fine. except
writing to log.

i have some code in global.asax and also trace entire webservice which
writes to the log

global.asax

Trace.AutoFlush = true;
StringBuilder strbTemp = new
StringBuilder("*********************************** *****************" +
Environment.NewLine + "[" + AppDomain.GetCurrentThreadId() + "]");
strbTemp.Append(" " + startTime.ToString("M/d/yyyy HH:mm:ss.fff") + " : ");
strbTemp.Append("Tets40 version ");
strbTemp.Append(Test40.m_WSVersion);
strbTemp.Append(" initialization start.");
Trace.WriteLineIf( Simulator40.m_traceMonitorSwitch.TraceVerbose,
strbTemp.ToString() );

web.config
<system.diagnostics>
<switches>
<!--Trace Switch Values:
0 Off: No tracing
1 Error: Trace errors only
2 Warning: Trace errors and warnings
3 Info: Trace errors, warnings, and informational events
4 Verbose: Trace everything -->

<add name="TraceMonitorSwitch" value="4" />
</switches>
<trace autoflush="true" indentsize="0">
<listeners>
<add name="ApplicationLogFile"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="D:\Test40\log\Test40.log" />
</listeners>
</trace>
</system.diagnostics>
I donno whats going on here ? the log is not being written but entire
functionality works fine.

please let me know.

thanks
Gouda
Mar 9 '06 #1
1 1668
As mentioned here:
http://www.thejoyofcode.com/DebugVie...internals.aspx, you need
to use the /d:TRACE switch with csc.exe otherwise the calls to
System.Diagnostics.Trace aren't compiled into your code.

They're decorated with the [Conditional("TRACE")] attribute.

Josh
http://www.thejoyofcode.com/

Mar 9 '06 #2

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

Similar topics

1
by: Paul C. | last post by:
I am new to programming in C# using Mono (mcs). What .dll does this "InitializeComponent()" method reside in? Code: // mcs web.cs -lib:C:\Program~1\Mono-1.0\lib -r:System.Data...
6
by: Davie | last post by:
I want to authorise a user of a web service by using the AuthHeaderValue for some reason I keep getting a null reference exception when I try to run the following code: It seems to work fine on a...
0
by: jim | last post by:
Hi Everyone, When I converted one visual .net project from 2002 to 2003, there is an error occursing during compiling under visual studio .net 2003 as followoing: Command Lines Creating...
5
by: Nick Gilbert | last post by:
Hi, I'm having problems using Flash Remoting with Web Services for ASP.NET and I've narrowed the problem down to csc.exe when it tries to compile the stub class. Flash Remoting...
7
by: Alessandro Benedetti | last post by:
Hi. I'm calling two methods of a .NET Webservice (A) from another Webservice (B). The A Webservice is made like this: public class WSA: System.Web.Services.WebService { private int X = 0;
5
by: AliR | last post by:
Hi Everyone, I have a Visual C++ MFC program, and I am trying to use a webservice written in C#. When I add the webservice to my project using Add Web Reference the sproxy compiler complains...
1
by: Thom Little | last post by:
I have a simple web service that requires no input and returns a character string. I created the service and FTPd it to a remote server. The .dll to the .bin directory and the single .asmx file...
0
by: =?Utf-8?B?TWFuaQ==?= | last post by:
Hi All, Problem in deploying my WebService developed using Asp.net WebServices 2005. I have designed simple WebService using Asp.net Webservices 2.0 , The webservice look this , using System;...
1
by: UT-BadBoy | last post by:
Hi, I've been receving this error "System.InvalidOperationException: The namespace, , is a duplicate." and have been unable to locate the exact cause of the exception. I've written a...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: 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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
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....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.