7

Here is my project structure:

.
|-- app.config
|-- bin
|   `-- Debug
|-- NLog.config
|-- NLog.xsd
|-- obj
|   `-- Debug
|-- packages.config
|-- Program.cs
|-- Properties
|   `-- AssemblyInfo.cs
|-- ServiceClient.csproj
`-- Web References
    `-- TestSvc
        |-- Reference.cs
        |-- Reference.map
        |-- TestService.disco
        `-- TestService.wsdl

7 directories, 14 files

I've manually compiled the project using the below mcs command:

mcs -d:TRACE -d:DEBUG -r:System.Web.Services.dll -out:./bin/Debug/ServiceClient.exe Web\ References/TestSvc/Reference.cs Program.cs

I've even copied the app.config to the target folder as ServiceClient.exe.config

Heres what the configuration looks like:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
    <sharedListeners>
        <add name="console" type="System.Diagnostics.ConsoleTraceListener"/>
        <add name="nlog" type="NLog.NLogTraceListener,Nlog"/>
    </sharedListeners>

    <sources>
        <source name="System.Net" switchValue="All">
            <listeners>
                <add name="nlog"/>
            </listeners>
        </source>
        <source name="System.Net.Sockets" switchValue="All">
            <listeners>
                <add name="nlog"/>
            </listeners>
        </source>
    </sources>
</system.diagnostics>
</configuration>

But when I run:

mono ServiceClient.exe "hello world"

I see no trace output...

deostroll
  • 11,661
  • 21
  • 90
  • 161

1 Answers1

0

Please try Mono log profiler.

Basically you need to run your application like this:

mono --profile=log ServiceClient.exe "hello world"

It will generate a file output.mlpd in the same directory. To see it:

mprof-report output.mlpd
wind39
  • 441
  • 4
  • 14
  • This does not give what I want. – deostroll Feb 03 '17 at 02:24
  • @deostroll Right, so what do you expect to see in the trace output? Can you provide an example? – wind39 Feb 03 '17 at 12:17
  • http://nlog-project.org/images/posts/2010/09/image_thumb1.png -> although this the console traceoutput is not framework standard (since its a custom tracelistener being used) it will look similar. – deostroll Feb 03 '17 at 12:52
  • those logging trace calls are inside the framework classes. As such I am not doing log traces in my main app. I've done exactly what you mention however. In fact that is the state of my configuration I originally posted in the question. I am aware mono has a different trace option which reports something entirely different; its not .net usual tracing. – deostroll Feb 03 '17 at 15:17
  • @deostroll You referenced `System.Web.Services.dll`. I was hoping your configuration file need to have something like this: ` ` – wind39 Feb 03 '17 at 15:54
  • The code in the app is just a asmx proxy client which calls a remote web method. The exercise is meant to test if tracesource logging works... in a sense the code is similar to what was there in the nlog page you linked to... – deostroll Feb 04 '17 at 01:49