diff -r 29f1a7a640ab paste/script/appinstall.py
--- a/paste/script/appinstall.py        Wed Oct 28 01:37:59 2009 -0500
+++ b/paste/script/appinstall.py        Tue Mar 02 10:04:43 2010 -0600
@@ -445,12 +445,15 @@
         config_file = os.path.join(os.getcwd(), config_file)
         self.logging_file_config(config_file)
         conf = appconfig(config_spec, relative_to=os.getcwd())
+        # Keep looking until the app context is found
+        while hasattr( conf.context, 'next_context'):
+            conf.context = conf.context.next_context
         ep_name = conf.context.entry_point_name
         ep_group = conf.context.protocol
         dist = conf.context.distribution
         if dist is None:
             raise BadCommand(
-                "The section %r is not the application (probably a filter).  You should add #section_name, where section_name is the section that configures your application" % plain_section)
+                "The section %r is not the application (probably a filter)" % ep_name)
         installer = self.get_installer(dist, ep_group, ep_name)
         installer.setup_config(
             self, config_file, section, self.sysconfig_install_vars(installer))

