title: How to get relative path to static string?
body: <p>In my Asp.Net page I have one webmethod that sends some data to other page and for this method I have to provide path, something like this: </p>
  
  <pre><code>string Path =&gt; Server.MapPath(@"\myPath1");
  
  [System.Web.Services.WebMethod]
  [ScriptMethod(UseHttpGet = true)]
  public static string GetAvailability()
  {
      //xdocDetail = XDocument.Load(Path); //THIS DO NOT WORK, NEEDS STATIC STRING
      xdocDetail = XDocument.Load(@"C:\Users\Eggii\Source\Repos\adm_app3\ADM_App\Content\Xmls\Detail.xml");
  
      List&lt;DetailList&gt; availabilityList = (from detail in xdocDetail.Descendants("Product")
                                           select new DetailList
                                           {
                                            Detail6 = (string)detail.Element("Availability") ?? "Unknown",
                                           }).ToList();
  
      return JsonConvert.SerializeObject(availabilityList.Select(x =&gt; x.Detail6));
  }
  </code></pre>
  
  <p>But I do not want that ugly full path in my method, is it possible somehow to get relative path to this webmethod? Or some other better solutions?</p>