OrchardSuppressDependency

Topics: Customizing Orchard
May 10, 2012 at 8:25 PM

namespace Custom.MyNameSpace
[OrchardSuppressDependency("Orchard.Environment.Extensions.ExtensionManager")]
public class AzureExtensionManager : IExtensionManager {
    //my AzureExtensionManager implementation
}

What am I missing here? code never gets hit. 

Assembly is in the base. Tried it in Modules also

Does it need a Module.txt to force a load? 

Developer
May 10, 2012 at 8:32 PM

If it's in a module, it does need a Module.txt and the module should be enabled.

May 10, 2012 at 9:33 PM
Edited May 10, 2012 at 10:22 PM

Put it in a module and enabled it.

I know the module is loading because I also added:

    public class Routes : IRouteProvider
    {
     }

Still no joy on the OrchardSuppressDependency class loading

Developer
May 11, 2012 at 10:12 AM

Is the ctor of AzureExtensionManager running?

May 11, 2012 at 12:54 PM

no its not being called, the one i'm trying to suppress is. 

Developer
May 11, 2012 at 1:06 PM

Then I have no idea. If your routes get properly registered, that means you module is loaded correctly. Your implementation is public, so it should be registered.

May 11, 2012 at 1:12 PM
Edited May 11, 2012 at 1:19 PM

ya a bit baffling, Thanks for the help. Will advise if I figure it out.

The class i'm trying to suppress is listed in the excludedTypes

May 11, 2012 at 1:39 PM
Edited May 11, 2012 at 4:34 PM

Can the Extension Manager itself not be suppressed?

The ExtensionManager is whats calling the CompositionStrategy for a list of exclusions/suppressed classes? 

Have I got the cart ahead of the horse?

Is this a better approach: 

 

    public class AzureExtensionManager : IExtensionManager
    {
	//Implement
    }
  <autofac defaultAssembly="Orchard.Framework">
    <components>

      <component instance-scope="single-instance"
                 type="Orchard.MyAzure.Environment.Extensions.AzureExtensionManager, Orchard.MyAzure"
                 service="Orchard.Environment.Extensions.IExtensionManager">
      </component>

    </components>
  </autofac>

????

The Saga Continues....

The ExtensionManager has a static bool , should not cause and issue.

 

       private static bool AlterationHasDependency(ShapeAlteration item, ShapeAlteration subject) {
            return ExtensionManager.HasDependency(item.Feature.Descriptor, subject.Feature.Descriptor);
        }

This approach is working so far, I added my class derived from IExtensionManager to the Orchard.Azure, moving it to my own Assembly now.

 

---
“Resolved, that I will live so, as I shall wish I had done when I come to die.” 
Jonathan Edwards