Please help VS2005 generates no MSIL for some statements..dissasembly attached


S

ste

VS2005, .NET2

I have a dll that is using TraceSources with no problems.

The dll is linked to a webservice.

The webservice creates its own traceSource and every thing looks fine..
however whenever i try and call a TraceEvent, TraceData method nothing gets
called.
Looking at the dissasembly, it is easy to see why.. no code has been
generated for the call .. arghhhhhhhhh


My problem is very similar to this issue, but this issue is for VS2003 and i
presume it has been fixed in 2005
http://www.kbalertz.com/kbNamed_891...avior.Visual.Basic.does.generate.correct.aspx


Can anyone suggest a workaround?


<<< Source below

System.Diagnostics.TraceSource xxx = new TraceSource("my.trace");
xxx.Switch = new SourceSwitch("my.trace.switch");
xxx.Listeners.Add(new ConsoleTraceListener());
xxx.Switch.Level = SourceLevels.Warning;
xxx.TraceData(TraceEventType.Critical, 1, new Object());
<--- no code generated for this line
bool b = xxx.Switch.ShouldTrace(TraceEventType.Verbose); <---
no problems here
xxx.TraceEvent(TraceEventType.Critical, 12, "help");
<--- no code generated for this line
xxx.Flush();

<< dissasembly.. see line 228

221:
222:
223:
224: System.Diagnostics.TraceSource xxx = new
TraceSource("my.edon.trace");
00000045 mov ecx,7A752FE8h
0000004a call 01330944
0000004f mov esi,eax
00000051 mov edx,dword ptr ds:[03A4ACB8h]
00000057 mov ecx,esi
00000059 call 797701EC
0000005e mov dword ptr [ebp-38h],esi
225: xxx.Switch = new SourceSwitch("my.trace.switch");
00000061 mov ecx,7A75640Ch
00000066 call 01330944
0000006b mov esi,eax
0000006d mov edx,dword ptr ds:[03A4ACBCh]
00000073 mov ecx,esi
00000075 call 7976AF48
0000007a mov edx,esi
0000007c mov ecx,dword ptr [ebp-38h]
0000007f cmp dword ptr [ecx],ecx
00000081 call 79771F08
00000086 nop
226: xxx.Listeners.Add(new ConsoleTraceListener());
00000087 mov ecx,dword ptr [ebp-38h]
0000008a cmp dword ptr [ecx],ecx
0000008c call 79771EC8
00000091 mov edi,eax
00000093 mov ecx,7A7645F4h
00000098 call 790FC9CC
0000009d mov esi,eax
0000009f mov ecx,esi
000000a1 call 79AE8990
000000a6 mov edx,esi
000000a8 mov ecx,edi
000000aa cmp dword ptr [ecx],ecx
000000ac call 7976F638
000000b1 nop
227: xxx.Switch.Level = SourceLevels.Warning;
000000b2 mov ecx,dword ptr [ebp-38h]
000000b5 cmp dword ptr [ecx],ecx
000000b7 call 79771EE8
000000bc mov esi,eax
000000be mov ecx,esi
000000c0 mov edx,7
000000c5 cmp dword ptr [ecx],ecx
000000c7 call 7976AFC8
000000cc nop
228: xxx.TraceData(TraceEventType.Critical, 1, new Object());
229:
230: bool b = xxx.Switch.ShouldTrace(TraceEventType.Verbose);
000000cd mov ecx,dword ptr [ebp-38h]
000000d0 cmp dword ptr [ecx],ecx
000000d2 call 79771EE8
000000d7 mov esi,eax
000000d9 mov ecx,esi
000000db mov edx,10h
000000e0 cmp dword ptr [ecx],ecx
000000e2 call 7976AFEC
000000e7 mov esi,eax
000000e9 mov eax,esi
000000eb and eax,0FFh
000000f0 mov dword ptr [ebp-28h],eax
234: xxx.TraceEvent(TraceEventType.Critical, 12, "help");
235: xxx.Flush();

http://www.kbalertz.com/kbNamed_891...avior.Visual.Basic.does.generate.correct.aspx




---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0606-2, 07/02/2006
Tested on: 08/02/2006 20:32:27
avast! - copyright (c) 1988-2005 ALWIL Software.
http://www.avast.com
 
Ad

Advertisements

C

Chris Dunaway

Does tracing depend on being in debug mode? Isn't there a /debug or
/trace switch to the compiler that enables it?
 
Ad

Advertisements

S

ste

Chris,

Thanks!!!! You were right....


Unable to find a setting in the web.config but #defining TRACE in my c#
source fixed it






Chris Dunaway said:
Does tracing depend on being in debug mode? Isn't there a /debug or
/trace switch to the compiler that enables it?



---
avast! Antivirus: Inbound message clean.
Virus Database (VPS): 0606-2, 07/02/2006
Tested on: 09/02/2006 19:22:08
avast! - copyright (c) 1988-2005 ALWIL Software.
http://www.avast.com




---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0606-2, 07/02/2006
Tested on: 09/02/2006 19:41:17
avast! - copyright (c) 1988-2005 ALWIL Software.
http://www.avast.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top