Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. A very unhappy System.Diagnostics.Debug.WriteLine

A very unhappy System.Diagnostics.Debug.WriteLine

Scheduled Pinned Locked Moved C#
csharpasp-netdebugginghelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RB Emphasys
    wrote on last edited by
    #1

    Hello All, I have this one asp.net 2.0 project that throws the following error when I attempt to use System.Diagnostics.Debug.WriteLine {"Couldn't create listener 'textWriterTraceListener'."} System.Exception {System.Configuration.ConfigurationErrorsException} It has an interesting inner exception of: InnerException {"Illegal characters in path."} System.Exception {System.ArgumentException} All of the other asp.net 2.0 apps I have run perfectly fine with that statement and previous versions of this application ran fine. Any ideas? Thanks in advance, Ryan

    G T 2 Replies Last reply
    0
    • R RB Emphasys

      Hello All, I have this one asp.net 2.0 project that throws the following error when I attempt to use System.Diagnostics.Debug.WriteLine {"Couldn't create listener 'textWriterTraceListener'."} System.Exception {System.Configuration.ConfigurationErrorsException} It has an interesting inner exception of: InnerException {"Illegal characters in path."} System.Exception {System.ArgumentException} All of the other asp.net 2.0 apps I have run perfectly fine with that statement and previous versions of this application ran fine. Any ideas? Thanks in advance, Ryan

      G Offline
      G Offline
      Gareth H
      wrote on last edited by
      #2

      RB@Emphasys, Show us some code.

      Regards, Gareth. (FKA gareth111)

      R 1 Reply Last reply
      0
      • G Gareth H

        RB@Emphasys, Show us some code.

        Regards, Gareth. (FKA gareth111)

        R Offline
        R Offline
        RB Emphasys
        wrote on last edited by
        #3

        I'm not sure exactly what you're looking for, it's simply erroring out when attempting to writeline, but here is the if statement:

        if (CertificationPerson_RaceTable.GetRecords("IsActive = 1 And fkPerson = " + oCertPersonRecord.PK).Length == 0)
        {
        //Errors out here, the objects are fully populated
        System.Diagnostics.Debug.WriteLine(oCertPersonRecord.PK + " " + oCertPersonRecord.fkRace);
        oPersonRaceRecord = new CertificationPerson_RaceRecord();
        oPersonRaceRecord.fkPerson = oCertPersonRecord.PK;
        oPersonRaceRecord.fkRace = oCertPersonRecord.fkRace;
        oPersonRaceRecord.Save();
        }

        Thanks, Ryan

        1 Reply Last reply
        0
        • R RB Emphasys

          Hello All, I have this one asp.net 2.0 project that throws the following error when I attempt to use System.Diagnostics.Debug.WriteLine {"Couldn't create listener 'textWriterTraceListener'."} System.Exception {System.Configuration.ConfigurationErrorsException} It has an interesting inner exception of: InnerException {"Illegal characters in path."} System.Exception {System.ArgumentException} All of the other asp.net 2.0 apps I have run perfectly fine with that statement and previous versions of this application ran fine. Any ideas? Thanks in advance, Ryan

          T Offline
          T Offline
          The Nightcoder
          wrote on last edited by
          #4

          Check your application settings (web.config). Sounds like it's trying to trace to a file but someone made a typo in the file name or path. As in:

          <configuration>
          <system.diagnostics>
          <trace autoflush="false" indentsize="4">
          <listeners>
          <add name="myListener"
          type="System.Diagnostics.TextWriterTraceListener"
          initializeData="InvalidFileNameHere.log" />
          <remove name="Default" />
          </listeners>
          </trace>
          </system.diagnostics>
          </configuration>

          I bolded the place to look for the error.

          Peter the small turnip (1) It Has To Work. --RFC 1925[^]

          R 1 Reply Last reply
          0
          • T The Nightcoder

            Check your application settings (web.config). Sounds like it's trying to trace to a file but someone made a typo in the file name or path. As in:

            <configuration>
            <system.diagnostics>
            <trace autoflush="false" indentsize="4">
            <listeners>
            <add name="myListener"
            type="System.Diagnostics.TextWriterTraceListener"
            initializeData="InvalidFileNameHere.log" />
            <remove name="Default" />
            </listeners>
            </trace>
            </system.diagnostics>
            </configuration>

            I bolded the place to look for the error.

            Peter the small turnip (1) It Has To Work. --RFC 1925[^]

            R Offline
            R Offline
            RB Emphasys
            wrote on last edited by
            #5

            Thanks Peter, That did the trick. I spaced out on that one.... Ryan

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups