title: How to debug a WebMethod in ASP.NET
body: <p>I have the following <code>WebMethod</code> in my <strong><code>fileName.asmx.cs</code></strong> file.</p>
  
  <pre><code>[WebMethod(EnableSession = true)]
  [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
  public string GetData(string value)
      {
          //-----
          //Respective code querying the database
          //-----
      }
  </code></pre>
  
  <p>Here is the respective ajax call using <strong><code>jQuery</code></strong></p>
  
  <pre><code>getData: function (type) {        
          var response = "";
          $.ajax({
              type: "POST",
              dataType: 'json',
              url: "../GetData",
              data: '{value:' + type.toString() + '}',
              async: false,
              contentType: "application/json; charset=utf-8",
              success: function (msg) {
                  console.log('succes', msg)
                  response = msg;
              }
          });
          return response.d;
      }
  </code></pre>
  
  <p>I add breakpoints in my <code>WebMethod</code> for debugging, however it is not stepping into it.
  I'm trying to do this my localhost:2133, With reference some SO Answers I also tried attaching the following process but no success.</p>
  
  <p><img src="https://i.stack.imgur.com/B56zQ.png" alt="enter image description here"></p>
  
  <p>Without debugging I'm not able to solve errors, Since I already wasted a couple of hours I posted here.</p>
  
  <p>Can someone guide me(couple of screenshots will be more helpful) <strong>how to debug a WebMethod in ASP.NET?</strong></p>
  
  <p><strong>Updates 1:</strong> I also tried putting <strong><code>Console.WriteLine()</code></strong> in the <code>WebMethod</code>.  But nothing shown in the output screen of VS2012.</p>
  
  <p><strong>Updates 2:</strong> I'm getting error will building the file, but the site is up in my localhost.  Is this error is causing me trouble to debug the WebMethod?  or to be clear</p>
  
  <p><strong>Only clean code (without error) can only be debugged?</strong></p>