locked
how to find fully qualified type names to use with custom exception and handler classes RRS feed

  • Question

  • User-1516799883 posted

    I have a .Net 2005 web app that is not defined as a class library. I don't put any of the classes in Namespaces (though I believe all classes are referenced as part of a Namespace)..  So, how can I know what the Fully Qualified Type Name of a class is in this case?

    I'm using the Exception Handling Application Block and the declaration of the custom exception class and custom handler I have, both need the FQTN in the web.config file.. (but I don't know what to put there!)

     Thanks!

    Thursday, April 10, 2008 2:37 PM

All replies

  • User-851968219 posted

    Why don't you try to use the class name of the page where you are putting the code. I think that should work. 

    Thursday, April 10, 2008 2:59 PM
  • User-1516799883 posted

    Thanks for the reply!

    The following is a sample of my Web.Config file generated using the Enterprise Library Configuration tool.  I'm modifying the server level web.config in the framework directory to apply the policies to the whole machine ("..." means I cut out code):

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    ...

      <exceptionHandling>
        <exceptionPolicies>
    ...
          <add name="Global Policy">
            <exceptionTypes>
              <add
      type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      postHandlingAction="NotifyRethrow"
      name="Exception">
                <exceptionHandlers>
                  <add
       type="MySample.AppMessageExceptionHandler, App_Code.7fg7bvaz, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
       name="Application Message Handler" />
                </exceptionHandlers>
              </add>
            </exceptionTypes>
          </add>
    ...

          <add name="Notify Policy">
            <exceptionTypes>
              <add
      type="MySample.BusinessLayerException, App_Code.7fg7bvaz, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
      postHandlingAction="ThrowNewException"
      name="BusinessLayerException">
    ...
              </add>
            </exceptionTypes>
          </add>
        </exceptionPolicies>
      </exceptionHandling>
    </configuration>

    Currently, I got the type specification for the two classes referenced in MySample by using the Enterprise Library Configuration tool and browsing to a DLL created in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\...

    Every other entry I've tried results in a "Namespace can't be resolved for class ..." error when I run the web app.

    I tried what I think you suggested as:

              <add
      type="MySample.BusinessLayerException, BusinessLayerException"
      postHandlingAction="ThrowNewException"
      name="BusinessLayerException">

    and it still gave me the error...  It seems like it wants the fully qualified name from the assembly... I'm just not sure where the assembly (dll) is?

    THANKS!! for any help

    Thursday, April 10, 2008 3:57 PM