1
Vote

Create Shared Attribute not working

description

Hi There,
 
We had created our own custom attribute called CreateNewOnce that creates a singleton instance of an object per HTTPContext. We did this by inherting from KnownParameter and overriding the GetValue method. But this stopped working in the newer version of the Composite.Web.dll. We researched this and found that we have to create our own version of the parameterResolver and that there is a CreateShared attribute that has been developed by one of the developers on CodePlex that does exactly the same job. So we have tried to use this CreateShared attribute exactly as is on the codeplex site but its not working. It creates a new object in the same HTTPContext pipeline.
 
Could someone please help and clarify what is going wrong? Is there any way I can look into the code the ILgenerater used in the EmitResolution method generates . Also, we put a breakpoint in the GetValue method and that method is never hit. We even put in debug.WriteLine statements in that method but it doesnt seem to be hitting it. How can we debug whats going wrong...Help will be greatly appreciated. We are at our wits end here! Here in I have pasted code from the GetValue method and the EmitResolution method. Pl let me know if more info is required..

file attachments

comments

jatindua wrote Jul 1, 2009 at 5:46 AM

Another attachment

wrote Jul 1, 2009 at 5:46 AM

jatindua wrote Jul 1, 2009 at 5:55 AM

Although attributes are called CreateNewOnce, code base is the same as the CreateShared attribute

wrote Feb 13, 2013 at 11:14 PM