ASP.Net HttpApplicationStateExtensions / sample code not working

Topics: Enterprise Library Core, General discussion
Jun 1, 2010 at 2:06 AM

The "recommended method" for creating the Unity container and the subsequent build up of a forms page (with a basic "dependent" property - for say the LogWriter) is not working if the exact source code from the documentation provided here ( ) is used.

Essentially the compiler is complaining: "Compiler Error Message: CS0121: The call is ambiguous between the following methods or properties: 'MyNameSpace.HttpApplicationStateExtensions.GetContainer(System.Web.HttpApplicationState)' and 'MyNameSpace.HttpApplicationStateExtensions.GetContainer(System.Web.HttpApplicationState)'

(The extension code does not seem  to work).  ( If I create the container without the extension code provided, my code for the forms page with the dependency is working fine.. ) I am unable to figure out what the issue is with the code provided in the documentation & why the application is crashing with the message above ..




Jun 1, 2010 at 2:35 AM

I tried those steps and it worked fine for me.  Please verify how many GetContainer methods do you have on your HttpApplicationStateExtensions as it specifically complains about that method being ambiguous.

BTW, please post Unity questions in the Unity forum

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.