IronPython attribute is not callable
Question: I have a problem with the following IronPython attribute (`RouteAttribute`):

    
    
    import clr
    import System
    from System.Web.Http import HttpGetAttribute, ApiController, RouteAttribute
    
    
    class DemoController(ApiController):
    
        @RouteAttribute("~/api/test")
        def test(self):
            return "Hallo Welt!"
    
    class DemoControllerClr:
    
        def getType(self):
            return clr.GetClrType(DemoController)
    

If i create an instance of the DemoController-Class, i always get the error-
message: `RouteAttribute is not callable`. I do not create an instance of
`DemoController` on my own, the asp.net web api 2 tries to do this.

Maybe some one has some experiances with attributes in IronPython.

**EDIT**

My aim is, to mix C# and IronPython API-Controller. I register the controller
like this (The c# ones works):

    
    
    controller = new Dictionary<string, System.Web.Http.Controllers.HttpControllerDescriptor>();
    
    controller.Add("General", new System.Web.Http.Controllers.HttpControllerDescriptor(config, "General", typeof(Controller.GeneralController)));
    
    foreach (DBScript script in dbContext.LoadData<DBScript>(optWherePart: "ScriptContentType = 1"))
    { 
        System.Diagnostics.Debugger.Launch();
    
        var sc = ScriptManager.Singleton.CreateScript(script.ScriptName, ScriptLanguage.IronPython);
    
        var clrInst = sc.GetClassInstance(script.ScriptName + "Clr");
    
        controller.Add(script.ScriptName.Replace("Controller", ""), new System.Web.Http.Controllers.HttpControllerDescriptor(config,
            script.ScriptName.Replace("Controller", ""), clrInst.getType()));
    }
    

**EDIT2**

I'm using the newest release of IronPython (2.7.5).

Thank you!


Answer: This did not work, bevause the dependency injection mechanism does not work
together with ironpython, because of the dlr. So just don't work.

