title: How to get the current project name in C# code?
body: <p>I want to send an email to myself when an exception is thrown. Using StackFrame object, I am able to get File Name, Class Name and even class method that throw the Exception, but I also need to know the project name as many of my ASP.NET project has the same file name, class name and method. </p>
  
  <p>This is my code:</p>
  
  <pre><code>    public static string JndGetEmailTextForDebuggingExceptionError(this Exception Ex)
      {
          StackFrame sf = Ex.JndGetStackFrame();
  
          string OutputHTML =         "&lt;i&gt;&lt;b&gt;&lt;u&gt;For Developer Use Only: &lt;/u&gt;&lt;/b&gt;&lt;/i&gt;"                                                 + "&lt;br&gt;" + 
                                                                                                                                        "&lt;br&gt;" +
                                      "Project Name:   "  + HttpContext.Current.ApplicationInstance.GetType().Assembly.GetName().Name + "&lt;br&gt;" + //Under discussion
                                      "File Name:      "  + sf.GetFileName()                                                          + "&lt;br&gt;" +
                                      "Class Name:     "  + sf.GetMethod().DeclaringType                                              + "&lt;br&gt;" +
                                      "Method Name:    "  + sf.GetMethod()                                                            + "&lt;br&gt;" +
                                      "Line Number:    "  + sf.GetFileLineNumber()                                                    + "&lt;br&gt;" +
                                      "Line Column:    "  + sf.GetFileColumnNumber()                                                  + "&lt;br&gt;" +
                                      "Error Message:  "  + Ex.Message                                                                + "&lt;br&gt;" +
                                      "Inner Message : "  + Ex.InnerException.Message                                                 + "&lt;br&gt;";
  
          return OutputHTML;
      }
  </code></pre>
  
  <p>Thanks ALL. </p>